JavaScript & jQuery Tutorials

JS Home Right Arrow JS Reference Right Arrow Date Right Arrow now()

now()  Date  class method

Description

Returns an integer value representing the milliseconds elapsed since 1 January 1970 00:00:00 UTC.

  • Like all class methods now() should be used on the class rather than an instance of the class.

Syntax


Signature Description
Date.now()Returns an integer value representing the milliseconds elapsed since 1 January 1970 00:00:00 UTC.

Parameters

None.

Examples

The code below shows an example of the now() method of Date.




// Show elapsed time in milliseconds.
alert(Date.now() + ' = Milliseconds since 1 January 1970 00:00:00 UTC.')


Press the button below to action the above code:



Related Tutorials

JavaScript Intermediate Tutorials - Lesson 2 - Dates and Times




  


go to home page Homepage go to top of page Top