Unix Timestamp Converter

Convert epoch time to a readable date, or any date and time zone back to a Unix timestamp.

Current Unix time

— Seconds
— Milliseconds
— ISO 8601 (UTC)

Your browser time zone: —. The clock comes from your device, so it is only as accurate as your system clock.

Conversions run in your browser using its built-in time zone database — nothing is sent to a server.

Advertisement

How to Use This Unix Timestamp Converter

The panel at the top shows the current Unix time in seconds and milliseconds, read from your device clock and refreshed ten times a second. Use Pause to freeze it while you copy a value. To decode a timestamp, paste it into the Timestamp → Date tab. The converter works out whether the number is in seconds, milliseconds, microseconds, or nanoseconds, then shows the moment in UTC, in your browser's time zone, and in any other zone you pick from the Also show in list. Each row has a copy button, so you can grab the ISO 8601 string for an API request or the RFC 2822 form for an email header without retyping it.

To go the other way, open Date → Timestamp, choose a date and time, and tell the tool which time zone that wall-clock time belongs to. The default is your local zone; switch to UTC if the time came from a server log, or to a specific city if a colleague in another country sent it. The result shows the timestamp in seconds and milliseconds along with ISO 8601 and RFC 2822 versions, and it warns you if the local time falls into a daylight saving gap or overlap.

What Unix Time Actually Measures

Unix time counts seconds from a fixed reference point, the epoch, defined as 00:00:00 UTC on 1 January 1970. A value of 0 is that instant, 86,400 is the same time a day later, and negative values count backwards, so -86,400 is 1 January 1969. Because the number refers to an instant rather than to a reading on a particular clock, it is identical everywhere in the world at the same moment. That property is what makes it so useful: two servers in different countries can compare timestamps directly, sort events, or compute durations with plain subtraction.

One detail surprises people: Unix time ignores leap seconds. Every day is treated as exactly 86,400 seconds long, even on the days when the world's timekeepers inserted an extra second to keep atomic time aligned with the Earth's rotation. During a leap second, a Unix clock either repeats a value or, on systems that use "leap smearing", runs very slightly slow for several hours. For everyday software this makes no practical difference, but it means the number of Unix seconds between two dates can be a few seconds shorter than the true number of elapsed seconds, which matters for scientific and navigation work.

Seconds, Milliseconds, or Microseconds? How Auto-Detection Works

Advertisement

Different platforms count in different units. Classic Unix tools, PHP's time(), Python's int(time.time()), and the exp and iat claims inside a JSON Web Token use seconds. JavaScript's Date.now() and Java's System.currentTimeMillis() use milliseconds. Some databases and tracing systems store microseconds, and Go's time.Now().UnixNano() returns nanoseconds. Because the epoch is the same for all of them, the unit is revealed by the size of the number. For present-day dates a seconds value has 10 digits, milliseconds 13, microseconds 16, and nanoseconds 19.

The converter treats values with up to 11 digits as seconds, 12 to 14 digits as milliseconds, 15 to 17 as microseconds, and anything longer as nanoseconds. Those cut-offs work for any date between roughly 1973 and the year 5000. The guess can be wrong for small millisecond values, such as timestamps from 1970 to early 1973 or test fixtures like 1000, so the unit menu lets you override it. Long values are parsed with exact integer arithmetic rather than floating point, so a 19-digit nanosecond timestamp keeps its precision, and the leftover sub-millisecond part is reported separately because JavaScript dates resolve only to the millisecond.

Reading the Output Formats

ISO 8601 is the format to prefer for data exchange: 2023-11-14T22:13:20.000Z. It sorts correctly as plain text, the trailing Z marks UTC, and the local variant ends with an explicit offset such as -05:00 so nobody has to guess the zone. RFC 2822 dates, like Tue, 14 Nov 2023 22:13:20 +0000, appear in email headers; HTTP headers use a closely related form that writes GMT instead of an offset. The relative row tells you at a glance whether a token has expired or a log entry is recent, and the day-of-year and ISO week fields help when reports are grouped by week. ISO weeks begin on Monday, and week 1 is the week that contains the year's first Thursday, so the first days of January can belong to the last week of the previous year.

Converting a Date to a Timestamp Across Time Zones

Turning a local date and time into a timestamp requires knowing which time zone it was in, and the offset of that zone is not constant: it changes with daylight saving time and has been changed by governments many times. This tool uses the IANA time zone database built into your browser through the Intl API, so historical rules are respected. A noon appointment in New York in July converts using UTC-4, while the same wall time in January uses UTC-5.

Daylight saving transitions create two awkward cases. When clocks spring forward, a range of local times never occurs; in the United States, 2:30 a.m. on the second Sunday in March does not exist. The converter moves such a time forward by the length of the gap, so 2:30 becomes 3:30 daylight time, which matches what most date libraries do. When clocks fall back, an hour repeats and a time like 1:30 a.m. happens twice. The tool reports both possible timestamps and uses the earlier one. If you are scheduling something in that hour, store the UTC instant or the offset alongside the local time.

The Year 2038 Problem

Many older systems store Unix time in a signed 32-bit integer, whose largest value is 2,147,483,647. That number of seconds after the epoch is 03:14:07 UTC on Tuesday, 19 January 2038. One second later, a 32-bit counter overflows and wraps around to -2,147,483,648, which those systems interpret as 20:45:52 UTC on 13 December 1901. Software that compares dates, schedules jobs, or calculates certificate expiry would suddenly see time running backwards. Try the 2038 limit button above to see the exact boundary.

The fix is to use a 64-bit time value, which pushes the overflow roughly 292 billion years into the future. Mainstream 64-bit operating systems, modern Linux kernels on 32-bit hardware, and current versions of languages and databases have already made that change, and JavaScript dates are not affected at all because they use a 64-bit floating-point millisecond count with a range of about 274,000 years either side of 1970. The remaining risk lies in long-lived embedded devices, old binary file formats, database columns declared as 32-bit integers, and network protocols with fixed 32-bit time fields. The note under each conversion tells you whether a value fits in a signed 32-bit integer.

Practical Tips and Common Mistakes

  • Mixing up units. Passing seconds to JavaScript's new Date(), which expects milliseconds, yields a date in January 1970. Multiply by 1,000 first. The reverse mistake, sending milliseconds to an API that expects seconds, produces dates tens of thousands of years in the future.
  • Storing local times without a zone. A string like 2024-11-03 01:30 cannot be converted back to a single instant. Store UTC timestamps or ISO 8601 strings with an offset, and convert to local time only for display.
  • Assuming a day is always 86,400 seconds of local time. On daylight saving changeover days, a local calendar day is 23 or 25 hours long. Add days with a date library rather than adding 86,400 to a timestamp when you mean "same time tomorrow".
  • Trusting the client clock. A user's computer clock may be wrong. For security decisions such as token expiry, compare against server time.

Frequently Asked Questions

What is a Unix timestamp?

A Unix timestamp (also called epoch time or POSIX time) is the number of seconds that have elapsed since 00:00:00 UTC on 1 January 1970, not counting leap seconds. Because it is a single number with no time zone attached, it is a convenient way to store and compare moments in time across systems.

How do I tell if a timestamp is in seconds or milliseconds?

Count the digits. Dates between 2001 and 2286 are 10 digits long in seconds and 13 digits long in milliseconds; microseconds have 16 digits and nanoseconds 19. This converter uses those magnitudes to auto-detect the unit, and you can override the guess with the unit selector, for example for millisecond values from before March 1973, which have 11 or fewer digits.

Do Unix timestamps depend on time zone?

No. A Unix timestamp identifies the same instant everywhere on Earth. Time zones only matter when you turn that instant into a calendar date and clock time for display, or when you turn a local date and time back into a timestamp.

What is the Year 2038 problem?

Systems that store Unix time as a signed 32-bit integer can count only up to 2,147,483,647 seconds, which is 03:14:07 UTC on 19 January 2038. One second later the value overflows and wraps to a large negative number that represents December 1901. Most modern operating systems and languages now use 64-bit time values, but old embedded devices, file formats, and database columns that still use 32 bits need to be updated before then.

Are leap seconds included in Unix time?

No. Unix time assumes every day has exactly 86,400 seconds. When a leap second is inserted, Unix time effectively repeats a second (or systems smear the extra second over a longer period), so the count of Unix seconds between two dates can differ slightly from the true number of elapsed SI seconds.

Why does a local time say it is ambiguous or does not exist?

Daylight saving time changes create gaps and overlaps. When clocks spring forward, local times inside the skipped hour never happen; this tool moves such a time forward by the length of the gap. When clocks fall back, an hour of local time happens twice; the tool shows both possible timestamps and uses the earlier one by default.

Related Articles

Expert guides and educational resources to help you master the math.

Advertisement