Unix Timestamp Converter

Timestamps to dates and back, with the unit worked out for you and stated.

Leave empty to see the current time. A bare number is read as a Unix timestamp.

Counting the digits

The only genuinely tricky part of reading a timestamp is working out its unit, and magnitude settles it. There is no ambiguity in practice, because the ranges do not overlap for any date anyone is actually working with.

DigitsUnitExampleWhere it comes from
10Seconds1787788800Unix, PHP, most APIs, JWT claims
13Milliseconds1787788800000JavaScript, Java, Kafka
16Microseconds1787788800000000Python time_ns()/1000, Postgres internals
19Nanoseconds1787788800000000000Go, InfluxDB, Prometheus

Getting it wrong is out by a factor of a thousand, so the result lands either in the early 1970s or tens of thousands of years in the future. Obvious when you look at it; entirely invisible when it is one column in a log table, which is where it actually bites.

What Unix time actually counts

Seconds since 00:00:00 UTC on 1 January 1970, assuming every day is exactly 86,400 seconds long.

That assumption is false. Leap seconds are inserted every few years to keep atomic time aligned with the Earth’s rotation, which is gradually slowing. Unix time does not represent them — systems repeat a second, or smear it across a day, so the count stays uniform.

The consequence is that Unix time is not a true count of elapsed seconds since 1970; it is about twenty-seven seconds short. For scheduling, logging and expiry that is exactly the right trade, because uniform arithmetic matters more than astronomical accuracy. For anything measuring real elapsed duration, use a monotonic clock instead — the wall clock can also jump backwards when NTP corrects it.

The 2038 problem

A signed 32-bit integer holds up to 2,147,483,647, which as a Unix timestamp is 03:14:07 UTC on 19 January 2038. One second later it overflows to negative and the date becomes December 1901.

Anything modern uses 64 bits and is good for roughly 292 billion years. What is not modern: embedded firmware, industrial controllers, some older database column types, and C code that still assumes a 32-bit time_t. The systems most at risk are the ones nobody is looking at, which is what made Y2K expensive too.

Which format to actually use

ISO 8601 in UTC, for anything crossing a boundary between systems or being read by a person:

2026-08-27T14:30:00Z

It is unambiguous, it sorts correctly as a plain string, and it is legible in a log at two in the morning. The Z matters: without it, most parsers assume local time, and you have invented a bug that only manifests for users in other countries.

Unix seconds are fine internally — they are what JWT exp and iat claims use, and integer comparison is cheap. The costs are that they are unreadable and that they invite the unit confusion above.

Worth avoiding: any format with an offset but no zone identifier (+01:00 does not tell you whether that is BST or CET, which matters for future dates), and anything in 03/04/2026 territory, which means two different days depending on which side of the Atlantic you read it on.

Storing future events

A subtlety that catches people out. For a meeting at 09:00 next March, storing UTC is wrong — if the timezone rules change between now and then, and governments do change them, the meeting moves. Future local events should be stored as a local time plus a zone identifier (Europe/London), and converted at display time using the rules current then. Past events are the opposite: UTC, because what happened is fixed.

Related

JWT exp and iat claims are Unix seconds — the JWT decoder converts them for you and flags expiry. For scheduling rather than converting, the cron parser shows when a schedule next fires.

Timestamp questions

Is my timestamp in seconds or milliseconds?

Count the digits. A current timestamp in seconds is 10 digits and will stay so until November 2286; in milliseconds it is 13. Sixteen digits is microseconds and nineteen is nanoseconds. Getting it wrong puts the answer out by a factor of a thousand, which lands you either just after 1970 or somewhere in the year 56000 — obvious once you look, invisible in a log. The converter states which unit it assumed, and lets you override it.

What is the year 2038 problem?

Systems that store Unix time in a signed 32-bit integer overflow on 19 January 2038, wrapping to December 1901. Anything modern uses 64 bits and is fine for about 292 billion years. What is not fine is embedded firmware, older databases, some filesystem formats and any C code still using a 32-bit time_t. It is the same shape of problem as Y2K and, like Y2K, it will mostly be handled quietly in advance by people you never hear about.

Why do timestamps ignore leap seconds?

Because Unix time is defined as the number of seconds since the epoch assuming every day is exactly 86,400 seconds — which is not true, since leap seconds are inserted occasionally to keep clocks aligned with the Earth's rotation. Rather than represent them, most systems repeat or smear a second so the count stays tidy. It means Unix time is not a true count of elapsed seconds, and for almost every purpose that is the right trade.

Which format should I use in an API?

ISO 8601 in UTC, with the Z suffix: 2026-08-27T14:30:00Z. It is unambiguous, sorts correctly as a string, and is readable by a person debugging a log at two in the morning. Unix seconds are fine internally and are what JWT claims use, but they are opaque to read and invite the seconds-versus-milliseconds confusion above. What to avoid is any format with a local offset but no zone, and anything in DD/MM versus MM/DD territory.

Why does my date show a different day than expected?

Almost always a timezone boundary. An ISO string without a zone is interpreted as local time by most parsers, while one ending in Z is UTC — so a timestamp late in the evening in London is already the next day in UTC, and one early in the morning in Los Angeles is still the previous day. Store and transmit in UTC; convert only when you display.

Last reviewed . Found something out of date? Tell us.