当前日期时间到字符串的转换 [英] conversion of current date time to string
本文介绍了当前日期时间到字符串的转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将系统的当前日期时间分配给字符串?
how to assigned current date time of system to the string???
推荐答案
DateTime CurrentDateTime = System.DateTime.Now;
string CurrentDateTime_InString = CurrentDateTime.ToString();
在datetime
变量上使用ToString()
. br/>
UseToString()
on yourdatetime
variable.
string dstr = DateTime.Now.ToString();
String CurDateTime = DateTime.Now.ToString();
要按照您的意愿设置日期和时间的格式,您可以查看此 LINK .
To format your date and time as your wish you can see this LINK.
这篇关于当前日期时间到字符串的转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文