300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > [JS]Tue Feb 01 000000 GMT+0800 (中国标准时间) 日期格式化

[JS]Tue Feb 01 000000 GMT+0800 (中国标准时间) 日期格式化

时间:2022-07-26 09:51:13

相关推荐

[JS]Tue Feb 01  000000 GMT+0800 (中国标准时间) 日期格式化

Tue Feb 01 00:00:00 GMT+0800 (中国标准时间) 转化为 yyyy/MM/dd HH:mm:ss

<script>/*获取当前年月*/var now = new Date(); //当前日期 var nowMonth = now.getMonth(); //当前月 var nowYear = now.getFullYear(); //当前年 //下月的开始日期var monthStartDate = new Date(nowYear, nowMonth + 1, 1);/*日期格式化*/function checkTime(i) {//时间if (i < 10) {i = "0" + i}return i;}var date = new Date(monthStartDate);//下边为主要部分date_value = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() + ' ' + checkTime(date.getHours()) + ':' + checkTime(date.getMinutes()) + ':' + checkTime(date.getSeconds());</script>

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