getAllTime(data){
let time = new Date(data);
let Y = time.getFullYear();
let Mon = time.getMonth()<10?'0'+time.getMonth():time.getMonth();
let Day = time.getDate()<10?'0'+time.getDate():time.getDate();
let hours=time.getHours()<10?'0'+time.getHours():time.getHours();
let minutes=time.getMinutes()<10?'0'+time.getMinutes():time.getMinutes();
let seconds=time.getSeconds()<10?'0'+time.getSeconds():time.getSeconds();
return `${Y}-${Mon}-${Day} ${hours}:${minutes}:${seconds}`
}
js获取本地的年月日以及处理后端不同时间类型
最新推荐文章于 2023-04-13 21:16:04 发布