如何从datetime数据类型的时间价值 [英] How to get the time value from DateTime datatype
本文介绍了如何从datetime数据类型的时间价值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有日期时间变量,我需要只能从变量的时间价值。
I have DateTime variable, and I need to get ONLY the time value from that variable.
我怎么能做到这一点在C#?
How can I do that in C#?
谢谢,
推荐答案
您可以试试这个....
You can try this....
someDateTime.ToString("hh:mm:ss");
这篇关于如何从datetime数据类型的时间价值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文