The now() method returns the number of milliseconds since January 1, 1970 00:00:00 UTC.
The now() method returns the number of milliseconds since January 1, 1970 00:00:00 UTC.
Date.now()
None
A Number, representing the number of milliseconds since midnight January 1, 1970
Return the number of milliseconds since 1970/01/01:
//The internal clock in JavaScript starts at midnight January 1, 1970. //display the number of milliseconds since midnight, January 1, 1970. var n = Date.now(); console.log(n);/*from w w w . ja va 2 s. c om*/ //Calculate the number of years since 1970/01/01: var minutes = 1000 * 60; var hours = minutes * 60; var days = hours * 24; var years = days * 365; var t = Date.now(); var y = Math.round(t / years); console.log(y);