如何获取格式为12:10:00的时间 [英] How to get time of the format 12:10:00
本文介绍了如何获取格式为12:10:00的时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好
我想以12:10:00
的格式显示当前时间
怎么可能
在Advance中致谢
Hi all
I want current time in the format 12:10:00
how its possible
Thanks in Advance
推荐答案
尝试:
DateTime now = DateTime.Now;
Console.WriteLine(now.ToString("hh:mm:ss"));
尝试一下.它会起作用
Try this. it will works
string currentTime = DateTime.Now.ToString("HH:mm:ss");
使用
System.DateTime.Now.ToString("hh:mm:ss")
这篇关于如何获取格式为12:10:00的时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文