Date.parse()
Parses a date string and returns its timestamp in milliseconds.
Syntax
Date.parse(dateString)
Returns
number — Milliseconds since the epoch, or `NaN` if the string is unparseable.
Examples
console.log(Date.parse("2026-05-15T00:00:00Z"));
Output
1779148800000
console.log(Date.parse("1970-01-01T00:00:00Z"));
Output
0
console.log(Date.parse("not a date"));
Output
NaN
Notes
- ISO 8601 strings are parsed reliably across engines; other formats
are implementation-dependent.
- A date-only ISO string is treated as UTC; a date-time without an
offset is treated as local.
- Prefer `new Date(isoString)` for readability.
Browser & runtime support
| Environment | Since version |
|---|---|
| chrome | 1.0 |
| firefox | 1.0 |
| safari | 1.0 |
| edge | 12 |
| node | 0.10 |