Home>

Comparison between new Date () and new Date (time)

console.log (new Date ());// Sat Aug 25 2018 04:34:24 GMT + 0900 (Japan Standard Time)
console.log (Math.floor (new Date (). getTime ()/(1000 * 60 * 60 * 24)));// 17767
var time = 1535112291408;
console.log (new Date (time));// Fri Aug 24 2018 21:04:51 GMT + 0900 (Japan Standard Time)
console.log (Math.floor (new Date (time) .getTime ()/(1000 * 60 * 60 * 24)));// 17767