从DateTime.Now.ToString()中删除日期;并显示秒数到3位数 [英] Remove Date from DateTime.Now.ToString(); and also display seconds to 3 digits
本文介绍了从DateTime.Now.ToString()中删除日期;并显示秒数到3位数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要用秒数3位数捕获当前时间
I need to capture the current time with 3 digits for seconds
推荐答案
使用ToString()方法的适当重载。怎么样呢?
Use an appropriate overload of the ToString() method. What about
string time = DateTime.Now.ToString("hh:mm:ss.fff");
这篇关于从DateTime.Now.ToString()中删除日期;并显示秒数到3位数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文