// formateDate('2019-10-24T13:30:02.870Z')
function formateDate(data){
date=new Date(data)
// console.log(date);//Thu Oct 24 2019 21:30:02 GMT+0800 (中国标准时间)
return date.getFullYear()+'-'+(date.getMonth()+1)+'-'+date.getDate()+' '+date.getHours()+':'+date.getMinutes()+':'+date.getSeconds()
// console.log(a);
}
日期格式化
最新推荐文章于 2024-03-11 09:46:21 发布