Standard built-ins

Date.parse()

Try the free JavaScript compiler

Interpret date text as a timestamp or NaN. Prefer specified ISO date-time format with explicit zone; other forms can be implementation-dependent.

Formal Syntax & Structure

javascript syntaxjavascript
Date.parse(text)

Parameters & Attributes

NameTypeDescription
textStringDate-time string.

Return Value

Number

Timestamp or NaN.

Working Example

Example Snippetjavascript
console.log(Date.parse("1970-01-01T00:00:02Z"));
JavaScript Reference