var ts = now.getTime()
ts -= new Date().getTimezoneOffset() * 60 * 1000
var utc = new Date(ts)
如果你的数字是16位整数,或许需要整除 1000,你对比普通的13位数字是否有对应换算关系。
d=new Date()//创建一个Date对象localTime = d.getTime()
localOffset=d.getTimezoneOffset()*60000//获得当地时间偏移的毫秒数
utc = localTime + localOffset//utc即GMT时间
offset =10//以夏威夷时间为例,东10区
gtm= utc + (3600000*offset)
nd = new Date(gtm)
document.writeln("gtm time is " + nd.toLocaleString() ")
<script>var d = new Date()
var year = d.getFullYear()
var month = d.getMonth() + 1
var date = d.getDate()
var hours = d.getHours()
var min = d.getMinutes()
var seconds = d.getSeconds()
var localDate = year+"-"+month+"-"+date + " " + hours + ":" + min + ":" + seconds
console.log(localDate) //结果 2018-5-23 12:53:32
</script>