1、时间和毫秒数的转换 (1)、时间转换为毫秒数 +new Date(); (new Date()).getTime()
(2)、毫秒数转换为日期格式 new Date("134553244436")
2、时间格式的转换 var unixTime = new Date();var userTime = new Date(45433565465);Date.prototype.layoutString = function() { return this.getFullYear() + "年" + (this.getMonth() + 1) + "月" + this.getDate() + "日 " + this.getHours() + "点" + this.getMinutes() + "分" + this.getSeconds() + "秒"; }; console.log(unixTime.layoutString()); console.log(userTime.layoutString());
00043745
如何转换日期格式,Python时间戳转换日期格式
来源:互联网 浏览:94次 时间:2023-04-08