mounted() {
const startTime = "2022-08-09";
console.log(this.handleStrTime(startTime)); //Tue Aug 09 2022 00:00:00 GMT+0800 (中国标准时间)
},
methods: {
handleStrTime(date) {
var t = Date.parse(date);
if (!isNaN(t)) {
return new Date(Date.parse(date.replace(/-/g, "/")));
} else {
return new Date();
}
},
},
日期转换为标准时间
最新推荐文章于 2023-07-24 17:22:49 发布