Copyright © tutorialspoint.com
Javascript date parse() method takes a date string and returns the number of milliseconds since midnight of January 1, 1970.
Date.parse(datestring) |
Note: Paramters in the bracket are always optional
Here is the detail of parameters:
datestring : A string representing a date
Number of milliseconds since midnight of January 1, 1970.
<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.
Copyright © tutorialspoint.com