<!doctype html> <html> <head> <title>Unix时间戳转换成日期格式</title> <script> var a = FormatDateTime("/Date(1497232433000)/") var b = FormatDateTime("1497232740000") console.log(a); //2017-06-12 09:53:53 cons…
var timestamp =1539598555000;//时间戳 //时间戳转换成time格式function timestampToTime(timestamp) { var date = new Date(timestamp );//时间戳为10位需*1000,时间戳为13位的话不需乘1000 Y = date.getFullYear() + '-'; M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMont…