Javascript date parse() method takes a date string and returns the number of milliseconds since midnight of January 1, 1970.
Its syntax is as follows −
Date.parse(datestring)
Note − Parameters in the bracket are always optional.
datestring − A string representing a date
Number of milliseconds since midnight of January 1, 1970.
Try the following example.
<html> <head> <title>JavaScript parse Method</title> </head> <body> <script type="text/javascript"> var msecs = Date.parse( "Aug 28, 2008 23:30:00" ); document.write( "Number of milliseconds from 1970: " + msecs ); </script> </body> </html>
Number of milliseconds from 1970: 1219946400000