JavaScript Code


JavaScript – Get Number of Milliseconds since January 1, 1970


Date – now()

Date.now()

now() is a static method of Date class.

now() returns the number of milliseconds elapsed since January 1, 1970 00:00:00 UTC.

Examples

1. Get the number of milliseconds elapsed since January 1, 1970 00:00:00 UTC.

const now = Date.now();
console.log(now);


Copyright @2022