This question is locked. New answers and comments are not allowed.
I wanted to convert the below VB code to C# code.
Dim dt As DateTime = DateTime.Now
Dim sKey As String
sKey=Format(dt,"yyyy/mm/dd hh:mm:ss")
Dim dt As DateTime = DateTime.Now
Dim sKey As String
sKey=Format(dt,"yyyy/mm/dd hh:mm:ss")
The Result I got from the online converter is as below:
DateTime dt = DateTime.Now;
string sKey = null;
sKey = Strings.Format(dt, "yyyy/mm/dd hh:mm:ss");
Firstly, there is no datatype called Strings in C#.
Secondly, the String.Format function does not have any function that accepts the parameters in the above format.
string sKey = null;
sKey = Strings.Format(dt, "yyyy/mm/dd hh:mm:ss");
Firstly, there is no datatype called Strings in C#.
Secondly, the String.Format function does not have any function that accepts the parameters in the above format.