Return the number of milliseconds since 1970/01/01:
The result of n could be:
The getTime() method returns the number of milliseconds between midnight of January 1, 1970 and the specified date.
![]()
The getTime() method is supported in all major browsers.
| Type | Description |
|---|---|
| Number | Milliseconds since midnight January 1, 1970 |
| JavaScript Version: | 1.0 |
|---|
Calculate the number of years since 1970/01/01:
The result of y will be:
JavaScript Date Object
Your message has been sent to W3Schools.