<html>
<body>
<p>Date.parse(string) returns milliseconds.</p>
<p>You can use the return value to convert the string to a date object:</p>
<p id="demo"></p>
<script>
var msec = Date.parse("March 21, 2012");
var d = new Date(msec);
document.getElementById("demo").innerHTML = d;
</script>
</body>
<!-- Mirrored from www.w3schools.com/js/tryit.asp?filename=tryjs_date_convert by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 02:39:31 GMT -->
</html>