From http://www.w3schools.com (Copyright Refsnes Data)
JavaScript Date Object
The parse() method takes a date string and returns the number of milliseconds since midnight of January 1, 1970.
| Date.parse(datestring) |
| Parameter | Description |
|---|---|
| datestring | Required. A string representing a date |
Example 1Get how many milliseconds there are from 1970/01/01 to 2005/07/08:
The output of the code above will be:
Try it yourself » |
Example 2Convert the output from the example above into years:
The output of the code above will be:
Try it yourself » |
JavaScript Date Object
From http://www.w3schools.com (Copyright Refsnes Data)