Date → Unix Timestamp
Convert a human-readable date to a Unix timestamp. Accepts ISO 8601 and most common formats.
0 characters
0 characters
About Date → Unix Timestamp
Parse a human-readable date and convert it to a Unix timestamp. The parser uses JavaScript's Date constructor, which accepts ISO 8601 (2024-01-15T10:30:00Z), RFC 2822 (Mon, 15 Jan 2024 10:30:00 GMT), and several other common formats. The output includes both seconds and milliseconds.
When to use it
- Producing timestamps for API requests
- Generating signed URL expiry values
- Converting calendar dates into database timestamp columns
- Verifying a date string is parseable
How it works
The input is passed to new Date(). If parsing succeeds, both seconds (getTime() / 1000) and milliseconds (getTime()) representations are produced. Time zone defaults to the value indicated in the input (Z for UTC, or browser local time if unspecified).
Examples
2024-01-15T10:30:00Z
Seconds: 1705314600 Milliseconds: 1705314600000
Frequently asked questions
- What date formats are accepted?
- ISO 8601 (recommended for portability), RFC 2822, and most natural-language forms that JavaScript's Date constructor recognizes. When in doubt, use ISO 8601: '2024-01-15T10:30:00Z'.
- Without a timezone, what's the default?
- Browser local time. To force UTC, append 'Z' to your date string. ISO 8601 dates with a 'T' but no timezone are ambiguous across browsers; appending 'Z' or '+00:00' makes the intent explicit.