JS时间格式转换

时间为 /Date(1489386788450+0800)/

 

function GetDate(date)
{
return new Date(parseInt(date.replace("/Date(", "").replace(")/", "").split("+")[0])).Format("yyyy-MM-dd hh:mm:ss")
}

 

alert((GetDate(要装换的时间));//输出为yyyy-MM-dd hh:mm:ss时间格式

posted @ 2021-04-02 14:18  Haoeaoi  阅读(246)  评论(0编辑  收藏  举报