How to format DateTime to 24 hours time?
C#DatetimeFormatC# Problem Overview
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.
C# Solutions
Solution 1 - C#
Solution 2 - C#
Console.WriteLine(curr.ToString("HH:mm"));