切记 php的时间戳 要乘以1000
changeTimeFormat(value.ctime*1000)
[js]
function changeTimeFormat(time) {
var date = new Date(time);
var month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
var currentDate = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
var hh = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
var mm = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
return date.getFullYear() + "-" + month + "-" + currentDate+" "+hh + ":" + mm;
//返回格式:yyyy-MM-dd hh:mm
}
[/js]
相关文章:
-
2022-12-23
-
2021-11-30
-
2022-12-23
-
2022-12-23
-
2021-09-10
-
2021-07-14
-
2021-10-13
-
2022-12-23
猜你喜欢
-
2022-02-12
-
2022-01-07
-
2021-11-28
-
2022-12-23
-
2022-12-23
-
2021-12-05
相关资源
-
下载
2023-03-14
-
下载
2021-06-05
-
下载
2021-07-02