码迷,mamicode.com
首页 > 编程语言 > 详细

JavaScript生成DateTime格式时间字符串

时间:2020-11-24 12:41:00      阅读:8      评论:0      收藏:0      [点我收藏+]

标签:mes   rgba   字符   class   pre   rip   get   time   col   

new Date().getFullYear()+‘-‘+( ( (new Date().getMonth()+1)<10 ? ‘0‘+ (new Date().getMonth()+1) : (new Date().getMonth()+1) ) )+‘-‘+ (new Date().getDate()<10 ? ‘0‘+new Date().getDate() : new Date().getDate())+‘ ‘+ new Date().toTimeString().substr(0,8)

 

JavaScript生成DateTime格式时间字符串

标签:mes   rgba   字符   class   pre   rip   get   time   col   

原文地址:https://www.cnblogs.com/bird-eat-vegetable/p/14010716.html

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