Favorites

JavaScript Date.parse() Method

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee
Date.parse()
JavaScript Date Static methodThis method is supported by all modern browsers.
Updated 28th November 2026

The Date.parse() static method converts a date string to a timestamp. Only the ISO 8601 format is parsed reliably by every browser.

Description

The Date.parse() static method parses a date string and returns its timestamp, or NaN if it isn't recognized. new Date(string) uses the same parsing. Only the ISO format, such as 2026-11-28 or 2026-11-28T10:00:00Z, is guaranteed to work everywhere; other formats depend on the browser.

Note that a date-only ISO string is treated as UTC, while a date-time string without a time zone is treated as local time.

If you control the format of the dates you're parsing, use ISO strings with an explicit time zone, such as a trailing Z or +10:30, to avoid ambiguity. For other formats, split the string yourself and pass the parts to new Date(year, month - 1, day), or use a date library.

Syntax

Date.parse(dateString)

Parameters

  • dateStringA string representing a date, ideally in ISO 8601 format.

Return Value

A timestamp in milliseconds, or NaN if the string can't be parsed.

Example

console.log(Date.parse('2026-11-28T00:00:00Z'));
console.log(new Date(Date.parse('2026-11-28')).toISOString());
console.log(Date.parse('not a date'));

Browser Support

The following information will show you the current browser support for the Date.parse() method. Hover over a browser icon to see the version that first introduced support for this method.

This method is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee