Skip to tool

Unix Timestamp Converter

Input
An epoch number or a date string such as ISO 8601 or RFC 2822.
Read as seconds. Detected from the number of digits; pick another unit to override.
UTC (ISO 8601)Example values
2023-11-14T22:13:20.000Z
Current time

Starting the clock…

Time zones1 zone(s)
Batch convert
Output

ISO 8601 time and epoch ms per line

What is a Unix timestamp?

A Unix timestamp, also called epoch time, is the number of seconds since 1970-01-01 00:00:00 UTC, not counting leap seconds. For example, 1700000000 is 2023-11-14T22:13:20Z. One instant has the same timestamp in every time zone; only the displayed date and time differ. Paste a timestamp to see it as ISO 8601, RFC 2822, a long local date and relative time ("2 years ago"), or paste a date to get its epoch seconds and milliseconds.

10-digit, 13-digit and longer timestamps

The unit is chosen from the digit count: up to 11 digits is seconds, 12–14 is milliseconds, 15–17 is microseconds and 18–20 is nanoseconds. Present-day values have 10, 13, 16 and 19 digits. Python time.time(), PHP time() and MySQL UNIX_TIMESTAMP() return seconds; JavaScript Date.now() and Java System.currentTimeMillis() return milliseconds; Go time.Now().UnixNano() returns nanoseconds. Click s, ms, us or ns to read the same number in another unit; editing the input runs detection again. Long values are parsed as BigInt so they are not rounded, but results are shown to the millisecond, and digits below one millisecond are dropped.

Converting a date to a timestamp

Date strings are parsed with the browser's Date.parse(). ISO 8601 (2024-01-15T08:30:00Z or 2024-01-15T16:30:00+08:00) is defined by the ECMAScript standard, and RFC 2822 (Mon, 15 Jan 2024 08:30:00 GMT) works in all major browsers. A date on its own, such as 2024-01-15, is read as midnight UTC. A date and time without Z or an offset, such as 2024-01-15 08:30, is read in your browser's time zone. Other formats depend on the browser. The ISO 8601 and RFC 2822 results are shown in your local zone with its UTC offset.

Converting a timestamp to another time zone

The Time Zones panel starts with UTC and your browser's zone. You can add any IANA zone name, such as Asia/Shanghai, Europe/London or America/New_York. Each row shows ISO 8601 with that zone's offset at that instant, so daylight saving time is applied: 1700000000 is 2023-11-15T06:13:20+08:00 in Asia/Shanghai and 2023-11-14T17:13:20-05:00 in America/New_York.

Batch conversion

Paste up to 1000 lines, one timestamp or date per line; lines after the 1000th are ignored. Each line uses the same detection rules. The result lists the UTC ISO 8601 value and epoch milliseconds for every line, plus an error code for lines that could not be parsed (empty lines count as failed). Copy it or download it as CSV, JSON or Markdown.

FAQ

How do I convert a 13-digit timestamp to a date?

A 13-digit timestamp is in milliseconds. Paste it as is: it is detected as ms and shown as a date. To get seconds, divide by 1000 and drop the decimals; 1700000000123 ms is 1700000000 s.

Why is my converted date in 1970 or tens of thousands of years ahead?

The unit is wrong, which shifts the result by a factor of 1000. 1700000000 read as milliseconds is 1970-01-20; 1700000000000 read as seconds is in the year 55840. Millisecond values before 1973-03-03 have 11 digits or fewer and are detected as seconds, so click ms for those.

How do I get the current Unix timestamp in code?

JavaScript: Math.floor(Date.now() / 1000). Python: int(time.time()). Java: Instant.now().getEpochSecond(). PHP: time(). MySQL: UNIX_TIMESTAMP(). Shell: date +%s. Here, the Current time section shows live seconds and milliseconds, and Now puts the current time into the input.

Does a Unix timestamp depend on the time zone?

No. It counts from a fixed UTC instant, so 1700000000 is the same moment everywhere. Time zones only change how that moment is written as a local date and time.

What happens to timestamps in 2038?

A signed 32-bit integer can hold up to 2147483647, which is 2038-01-19T03:14:07Z; systems that store time in 32 bits overflow after that. This tool has no such limit: it accepts any instant JavaScript Date can represent, about 100 million days either side of 1970 (years −271821 to 275760).

Can I share a specific conversion?

Yes. The address bar updates with the input, unit and time zone list as you change them; copy the URL to share the same view.