I need string from datetime to display time in 24 hours format.
.. var curr = DateTime.Now; string s = ???; Console.WriteLine(s); ..
The o
Console.WriteLine(curr.ToString("HH:mm"));
Use upper-case HH for 24h format:
HH
String s = curr.ToString("HH:mm");
See DateTime.ToString Method.