1、DateTime 数字型
System.DateTime currentTime=new System.DateTime();
1.1 取当前年月日时分秒
currentTime=System.DateTime.Now;
int 年=currentTime.Year;
int 月=currentTime.Month;
int 日=currentTime.Day;
int 时=currentTime.Hour;
int 分=currentTime.Minute;
int 秒=currentTime.Second;
int 毫秒=currentTime.Millisecond;
(变量可用中文)
DateTime数字类型格式
最新推荐文章于 2021-12-10 10:36:27 发布
博客介绍了在C#里使用DateTime数字型获取当前时间的方法。通过System.DateTime.Now获取当前时间,还展示了分别获取年、月、日、时、分、秒和毫秒的代码示例。
195

被折叠的 条评论
为什么被折叠?



