300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > 将中国标准时间转化为 yy-mm-dd hh:mm:ss格式

将中国标准时间转化为 yy-mm-dd hh:mm:ss格式

时间:2019-08-27 13:06:57

相关推荐

将中国标准时间转化为 yy-mm-dd hh:mm:ss格式

如题

let newDate = new Date(new Date() - 24 * 3600 * 1000);function YymmddFormat(newDate) {let Month = newDate.getMonth() + 1;Month = Month >= 10 ? Month : '0' + Month;let d = newDate.getDate();d = d >= 10 ? d : '0' + dreturn [[newDate.getFullYear(), Month, d].join('-'), [newDate.getHours(), newDate.getMinutes(), newDate.getSeconds()].join(':')].join(' ');}YymmddFormat(newDate) // yy-mm-dd hh:mm:ss

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。