我的mongo db上有这个日期
48603-01-01T03:17:12.000Z
当我在转换器网站上转换此日期时
Results
Input 02/14/48603
Input (parsed) Monday, February 14, 48603 12:00:00 AM UTC
Input (parsed, GMT) Monday, February 14, 48603 12:00:00 AM GMT
Result 1,471,599,100,800,000
Result (unformatted) 1471599100800000
Result (hex) 0x53a695da7ac00
我得到了这个。然后我再次转换为divin到1000之后的日期
Input 1471629600720
Input (formatted) 1,471,629,600,720
Date (Etc/UTC) Friday, August 19, 2016 6:00:00 PM UTC
Date (GMT) Friday, August 19, 2016 6:00:00 PM GMT
Date (short/short format) 8/19/16 6:00 PM
在应用程序中,我乘以1000进行转换。
因此,为了修复,我必须在转换为毫秒后首先划分为1000
1471599100800000
/
1000 = 1471599100800
但是我不知道我应该编写什么脚本,因为它在一年内是5位数,这些功能在chrome控制台中不起作用:
var myDate = new Date("48603-01-01T03:17:12");
var result = myDate.getTime();
console.log(result);
VM3347:3 NaN
undefined
var myDate = new Date("4863-01-01T03:17:12");
var result = myDate.getTime();
console.log(result);
VM3348:3 91294301832000
有什么建议?
这很有用
var myDate = new Date("+048063-01-01T03:17:12");
var result = myDate.getTime();
console.log(result);
VM3405:3 1454554628232000
undefined