How to use parse in JavaScript
In this article, I will explain use of parse() method in JavaScript date object.
JavaScript Date Object
JavaScript parse() method
parse() method takes a date string and returns the number of milliseconds between the date string and midnight of January 1, 1970.
Syntax
Example
In the following example show to parse() method converts the string representation of the date.
<!DOCTYPE html>
<html>
<body>
<h3 style="color:ThreeDDarkShadow">JavaScript parse() Method Example</h3>
<p id="demo">Click for display milliseconds between a given date and January 1, 1970.</p>
<button onclick="myFunction()">Click On</button>
<script type="text/javascript">
function myFunction() {
var d = Date.parse("July 12, 2012");
var x = document.getElementById("demo");
x.innerHTML = "Milliseconds is :" + d;
}
</script>
</body>
</html>
|
Output1

Output2

You may also want to read these related articles here
Ask Your Question
Got a programming related question? You may want to post your question here
Programming Answers here