JavaScript parse date
In this section, you will learn how to parse the date in JavaScript.
JavaScript provides the function parse() that takes a date in string format and returns the equivalent number of milliseconds elapsed since 1 Jan 1970. In the given example we have passed date March 7, 2009 to the method parse() which returns the number of milliseconds since January 1, 1970 to March 7, 2009.
Here is the code:
| <html> <h2>Parse Date</h2> <script type="text/javascript"> var parseCurrentDate = Date.parse("March 7, 2009"); document.write("The number of milliseconds since 01/01/1970 to 07/03/2009 : "+parseCurrentDate); </script> </html> |
Output will be displayed as:
Tutorials
- Java 26 (JDK 26) Features with examples
- Top 10 Reasons to Learn Java in 2026
- JDK 26 Tutorial
- Java Certification Roadmap 2026: Which Oracle Certs Matter
- Install JDK 26: A Complete Beginner's Guide (2026)
- What Is Java? A Complete, Up-to-Date Guide for 2026
- Java 26 HTTP3 tutorial - HTTP 3 support in JDK 26 - How to use HTTP/3 in Java 26 application?
- JDK 28 Preview: Value Objects, Shenandoah GC & JSON API
- Java Tutorials


