JavaScript Date Object
The parse() method parses a date string and returns the number of milliseconds between the date string and midnight of January 1, 1970.
| Parameter | Description |
|---|---|
| datestring | Required. A string representing a date |
![]()
The parse() method is supported in all major browsers.
Return the number of milliseconds from January 1, 1970 to July 8, 2005:
The output of the code above will be:
Convert example 1 into years:
The output of the code above will be:
JavaScript Date Object
| WEB HOSTING |
|---|
| Best Web Hosting |
| PHP MySQL Hosting |
| Best Hosting Coupons |
| UK Reseller Hosting |
| Cloud Hosting |
| Top Web Hosting |
| $7.95/mo SEO Hosting |
| Premium Website Design |
| WEB BUILDING |
|---|
| XML Editor - Free Trial! |
| FREE Website BUILDER |
| Free Website Templates Free CSS Templates |
| Make Your Own Website |
| W3SCHOOLS EXAMS |
|---|
|
Get Certified in: HTML, CSS, JavaScript, XML, PHP, and ASP |
| W3SCHOOLS BOOKS |
|---|
|
New Books: HTML, CSS JavaScript, and Ajax |
| STATISTICS |
|---|
|
Browser Statistics Browser OS Browser Display |
| SHARE THIS PAGE |
|---|