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.

How to convert a timestamp or a date

  1. Type or paste a value into Timestamp or date. A number may start with a minus sign for instants before 1970; anything that is not all digits is treated as a date string.
  2. For a number, check Unit. The detected unit is selected; pick s, ms, µs or ns to override it. Unit has no effect on a date string.
  3. Read the result. The top line is always UTC. ISO 8601, RFC 2822 and Locale (long) use your browser's time zone. Each row has a copy button, and the one on the top line copies every row. While the input is invalid, the last valid result stays on screen, dimmed.
  4. Under Time zones, type part of a zone name into Add a time zone and pick a match. Each zone you add gets its own row.
  5. For many values, paste them into Batch convert, one per line, or click Try an example. Choose CSV, JSON or Markdown, then Copy or Download.

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, µs 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 the reason for lines that could not be parsed (empty lines count as failed). Copy it or download it as CSV, JSON or Markdown.

Timestamp conversion examples

  • -1 → 1969-12-31T23:59:59.000Z, and -86400 → 1969-12-31T00:00:00.000Z. Negative values count back from 1970.
  • 1700000000123456789 (19 digits, nanoseconds) → 2023-11-14T22:13:20.123Z, with Epoch milliseconds 1700000000123. The last six digits are dropped.
  • 2024-01-15T08:30:00+08:00 → 2024-01-15T00:30:00.000Z, Epoch seconds 1705278600.
  • Clocks going forward: in America/New_York, 1710053999 is 2024-03-10T01:59:59.000-05:00 and one second later, 1710054000, is 2024-03-10T03:00:00.000-04:00. Local times from 02:00 to 02:59 did not exist that day.
  • Clocks going back: 1730613599 is 2024-11-03T01:59:59.000-04:00 and 1730613600 is 2024-11-03T01:00:00.000-05:00. The hour from 01:00 to 01:59 happened twice, and only the offset tells the two apart.

Rounding and relative time conventions

Digits below the displayed unit are cut off, not rounded: 1700000000999 ms shows Epoch seconds 1700000000, not 1700000001. Before 1970 the cut is toward zero, so -1500 ms (1969-12-31T23:59:58.500Z) shows Epoch seconds -1, while floor division, such as Python's // operator, gives -2. Relative uses fixed lengths of 365 days for a year, 30 days for a month and 7 days for a week. It takes the largest unit that fits and rounds to the nearest whole number: 547 days back reads “last year”, 548 days reads “2 years ago”, and 45 days reads “last month”. It is calculated when the result is drawn and does not tick; only the Current time section updates every second.

Common timestamp mistakes

  • Pasting a formatted number. 1,700,000,000, 1700000000.5, +1700000000 and 1e9 all fail with “Could not parse this value.” A number may contain only digits and a leading minus sign. For fractional seconds, drop the dot and read the value as milliseconds: 1700000000.5 s is 1700000000500.
  • Trusting a date that does not exist. In Chrome, 2024-02-30 is not rejected; it rolls over to 2024-03-01T00:00:00.000Z.
  • Writing the day first or leaving out the separators. In Chrome, 15/01/2024 and 20240115T083000Z are rejected, and 01/15/2024 is read month first. Write 2024-01-15 or 2024-01-15T08:30:00Z.
  • Small millisecond values in Batch convert. Batch lines always use digit-count detection and ignore the Unit buttons, so 86400000, meant as milliseconds (1970-01-02), comes out as 1972-09-27T00:00:00.000Z. Convert such values one at a time in the main input.
  • Searching for a zone by abbreviation or capital city. EST, PST, CST and Beijing return “No matching time zone.” The list holds IANA names, which combine a region and a city and use underscores: search New_York, Los_Angeles or Shanghai.

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.