getTime()

The getTime() method is used to return the number of milliseconds which has passed since January 1st, 1970. The time for which is the taken from the date specified by your operating system, and used by the Date object. The value returned is in milliseonds.

syntax:

dateName.getTime()

EXAMPLE

dateObject = new Date();

document.write("The date is: " + dateObject.getTime());

The example shows the creation of a new Date object, called dateObject. It is then used within a document.write statement, with the getTime() method to display its value.