ES6 - gettime() Method



JavaScript date getTime() method returns the numeric value corresponding to the time for the specified date according to universal time. The value returned by the getTime method is the number of milliseconds since 1 January 1970 00:00:00.

You can use this method to help assign a date and time to another Date object.

Syntax

Date.getTime ()  

Return Value

Returns the numeric value corresponding to the time for the specified date according to universal time.

Example

var dt = new Date("December 25, 1995 23:15:00"); 
console.log("getTime() : " + dt.getTime());  

Output

getTime() : 819913500000   
Advertisements