How to get time in milliseconds since the Unix epoch in JavaScript?

JavascriptWeb DevelopmentFront End Technology

The standard Unix epoch is an expression in seconds. The Unix epoch or Unix time is the number of seconds elapsed since January 1, 1970.

The getTime() method is used to return the millisecond representation of the Date object.

To get time in milliseconds, use the following:

var milliseconds = (new Date).getTime();
Updated on 24-Sep-2019 08:30:59