JavaScript Date.parse() Method

You are Here:

JavaScript Date.parse() Method

The Date.parse() method parses a date string and returns the number of milliseconds between the date string and midnight of January 1, 1970.

This function is useful for setting date values based on string values.


HTML Online Editor
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Display Milliseconds</button> <p id="point"></p> <script> function myFunction(){ var d = Date.parse("May 19, 1995"); document.getElementById("point").innerHTML = d; } </script> </body> </html>



Parameter Values

xoptionalA string representing a simplification of the ISO 8601 calendar date extended format.

Return Value

NumberReturns a number representing the milliseconds elapsed since January 1, 1970, 00:00:00 UTC and the date obtained by parsing the given string representation of a date.
NaNIf the argument doesn't represent a valid date.


Hi Developers, we almost covered 97% of JavaScript Tutorials with examples for quick and easy learning.

We are working to cover every Single Concept in JavaScript.

Please do google search for:

Join Our Channel

Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.

This channel is primarily useful for Full Stack Web Developer.

Share this Page

Meet the Author