如何将DateTime格式化为24小时制?


78

我需要日期时间的字符串以24小时格式显示时间。

..
var curr = DateTime.Now;
string s = ???;
Console.WriteLine(s);
..

输出结果必须为:“ 16:38”谢谢。


1
OmG

Answers:



By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.