js格式化标准时间Thu Dec 02 2021 10:29:45 GMT+0800 (中国标准时间)转化成字符串

编程入门 行业动态 更新时间:2024-10-20 21:09:48

js格式化标准<a href=https://www.elefans.com/category/jswz/34/1771441.html style=时间Thu Dec 02 2021 10:29:45 GMT+0800 (中国标准时间)转化成字符串"/>

js格式化标准时间Thu Dec 02 2021 10:29:45 GMT+0800 (中国标准时间)转化成字符串

 var nowTime = new Date();   // Date Thu Dec 02 2021 16:10:53 GMT+0800 (中国标准时间)let time = nowTime.getFullYear() + '-' + (nowTime.getMonth() + 1) + '-' +nowTime.getDate() + ' ' + nowTime.getHours() + ':' + nowTime.getMinutes() + ':' + nowTime.getSeconds();console.log(time);  // 2021-12-2 16:10:53
// 一天的时间86400000
var yesterdsay = new Date(new Date().getTime() - 86400000);

更多推荐

js格式化标准时间Thu Dec 02 2021 10:29:45 GMT+0800 (中国标准时间)转化成字符串

本文发布于:2024-02-24 16:21:25,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1695935.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:时间   标准   字符串   中国   转化成

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!