// var time = [获取到的时间/日期字符串] * 1;
new Date(time).toLocaleDateString();
// 根据自己的需求重写toLocaleDateString
Date.prototype.toLocaleString = function() {
return this.getFullYear() + "/" + (this.getMonth() + 1) + "/" + this.getDate() + "/ "
+ this.getHours() + ":" + this.getMinutes() + ":" + this.getSeconds();
};
从后台获得的日期或时间(毫秒格式)转为指定格式
最新推荐文章于 2021-09-15 11:30:11 发布