Copyright © tutorialspoint.com

Javascript Date parse() Method

previous next

Advertisements


Description:

Javascript date parse() method takes a date string and returns the number of milliseconds since midnight of January 1, 1970.

Syntax:

Date.parse(datestring)

Note: Paramters in the bracket are always optional

Here is the detail of parameters:

Return Value:

Number of milliseconds since midnight of January 1, 1970.

Example:

<html>
<head>
<title>JavaScript parse Method</title>
</head>
<body>
<script type="text/javascript">
   var msecs = Date.parse("Jul 8, 2008");
   document.write( "Number of milliseconds from 1970: " + msecs ); 
</script>
</body>
</html>

This will produce following result :

Number of milliseconds from 1970: 1215455400000 

To understand it in better way you can Try it yourself.


previous next

Copyright © tutorialspoint.com