码迷,mamicode.com
首页 > Windows程序 > 详细

C# DateTime 时间格式化

时间:2016-03-26 15:24:41      阅读:177      评论:0      收藏:0      [点我收藏+]

标签:

今天做任务的时候,数据库日期拼写需要 从凌晨到晚上最后一秒,但是传过来的日期数据是 当前的时间,下面是我尝试的解决方案。

 

endTime.ToString("yyyy-MM-dd 23:59:59")    // 2016-03-29 23:59:59

endTime.ToString("yyyy-MM-dd HH:mm:ss"))  //   2016-3-29 14:37:31

endTime.ToString();       //   2016/3/29 14:37:31

C# DateTime 时间格式化

标签:

原文地址:http://www.cnblogs.com/fhlsteven/p/5322913.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!