I need string from datetime to display time in 24 hours format.
..
var curr = DateTime.Now;
string s = ???;
Console.WriteLine(s);
..
The output result have to be: "16:38" Thank you.
I need string from datetime to display time in 24 hours format.
..
var curr = DateTime.Now;
string s = ???;
Console.WriteLine(s);
..
The output result have to be: "16:38" Thank you.
Use upper-case
HH
for 24h format:See DateTime.ToString Method.