Unix Timestamp Converter and Diagnostic

Paste a value, a log line, a JSON field or a date — every candidate number gets its own diagnosis: which unit it is, what date it means, and why it looks wrong. All in your browser.

Any run of 9 to 19 digits is picked out of the text — up to five at a time — and each one gets its own diagnosis. Nothing is uploaded; this all runs in the page.

Unit (auto, by digit count)

Auto follows the digit count in the table below. Override it when the digits look fine but the year does not.

When you need this

  • A log line says ts=1716105600 and you need to know whether that is last week or 1970, without opening a REPL.
  • An API returns a thirteen-digit number that renders as January 1970 in your UI, and you cannot tell whether it is milliseconds, microseconds, or a failed parse.
  • You inherited a column of epoch values and want to see which ones are seconds and which are milliseconds before writing the migration.

Why other timestamp converters fall short

They convert; they do not diagnose. Paste a thirteen-digit millisecond value into a converter that assumes seconds and you get a date tens of thousands of years out, with no warning that anything is wrong.

A 1970-01-01 result is printed as if it were an answer. That date is nearly always a unit mistake or a parser default, and it deserves an explanation rather than a date field.

Most of them take exactly one number, so a log line or a JSON snippet has to be pulled apart by hand before it can be pasted.

The 2038 problem, in one paragraph

On a great many older systems a Unix timestamp is a signed 32-bit integer, and that integer stops at 2,147,483,647. As seconds, that is 1970-01-19 03:14:07 UTC. One second later the counter overflows and wraps to the most negative value the type can hold, which is 1901-12-13 20:45:52 UTC.

What still cares: 32-bit time_t builds on embedded Linux, older PHP and MySQL versions, Java columns typed as int, and a long tail of firmware that will never ship another update. Anything already using 64-bit integers is fine for roughly 292 billion years, which is the practical answer to "is this my problem".

You do not fix it by changing the number. You fix it by widening the type before 2038 arrives — BIGINT instead of INT, long instead of int, a time_t compiled as 64-bit. A value past 2,147,483,647 is not corrupt; the storage is too narrow.

Why the result is 8 hours off (and why the timestamp is fine)

A timestamp has no time zone in it. It counts seconds since 1970-01-01T00:00:00Z, so the same second is the same number in every country on earth. If two systems disagree by exactly eight hours, they are not disagreeing about the timestamp — one is rendering it in UTC+08:00 and the other in UTC. The number agrees; the displays do not.

The same confusion appears without any timestamp at all. A bare string like 2026-11-17 14:03:01 carries no offset, so Date.parse reads it in the machine's local zone, while the server that produced it may have written UTC. Two correct parsers, one wrong assumption, eight hours of difference.

Two things fix it permanently: store and transmit UTC (ISO 8601 with a trailing Z), and convert to a local zone only at the moment you draw the value. When you must parse an offset-less string, decide the assumed zone explicitly instead of letting the platform pick one for you — this page makes the assumption visible for exactly that reason, by printing the machine's offset next to the local reading.

What unit does each stack use by default?

This is where most factor-of-1000 errors come from: the same word means seconds in one stack and milliseconds in another, and nothing in the value itself says which.

Go deserves a special mention because it is the one that disagrees with itself: Unix() returns seconds while UnixNano() returns nanoseconds. Mixing them up moves the date by about 56,000 years, which is the kind of number that looks like an overflow rather than a mistake.

StackDefault unit
Java — System.currentTimeMillis()milliseconds
Python — time.time()seconds (float; time.time_ns() for nanoseconds)
JavaScript — Date.now()milliseconds
PHP — time()seconds
Go — time.Now().UnixNano()nanoseconds
MySQL — FROM_UNIXTIME()seconds
PostgreSQL — to_timestamp()seconds, but takes a double, so fractions survive

Two things people get wrong about Unix time

Unix time does not count leap seconds. It pretends every day has exactly 86,400 seconds, so it drifts away from UTC by the 27 leap seconds inserted since 1972. For logging, ordering events and scheduling, that is irrelevant. For astronomy, or anything that must line up with UTC to the second across decades, it is not — and a conversion tool that hides this is helping you build the wrong thing.

Negative timestamps are valid, and many systems cannot hold them. Counting backwards from the epoch gives real dates before 1970 — minus 86400 is 1969-12-31 00:00:00 UTC — but unsigned integer columns, 32-bit time_t and several JSON parsers reject them or clamp them to zero. That clamping is one of the reasons a pre-1970 date sometimes surfaces as 1970-01-01, which then looks like a default value rather than a rejected one.

Digits → unit

A timestamp carries no unit — only the digit count tells you what it is. This table is generated from the same constant the tool reads, so the page and the code cannot drift apart.

DigitsUnitCovers roughly
10seconds2001 – 2286
13milliseconds2001 – 2286
16microseconds1970 – 2286
19nanoseconds1970 – 2286

Frequently asked questions

Is the value I paste uploaded anywhere?

No. There is no backend: the parsing, the unit inference and the date maths all run in this page. You can confirm it yourself — open DevTools, switch to the Network tab, paste a value, and watch that no request is made. It also keeps working with the network disconnected once the page has loaded.

Why does my value show up as 1970?

The card above the result says which of the three causes applies to your number: a parser default of zero, a value truncated to zero by the unit, or a genuinely negative timestamp that something clamped. 1970-01-01 00:00:00 on its own is not an answer, which is why this page never prints it alone.

How do I know whether my number is seconds or milliseconds?

The digit count decides it, and the table further up this page lists the four widths with the range each one covers. That table is generated from the same constant the code reads, so it cannot tell you something the tool will not do. Values outside those four widths are inferred and labelled as inferred — switch the unit above if the date looks wrong.

What is the 2038 problem?

A signed 32-bit integer cannot hold a second count past 2,147,483,647, which is 1970-01-19 03:14:07 UTC; one second later it wraps to 1901. The section above covers which systems still care and what actually fixes it.

My conversion is eight hours off. Is the timestamp wrong?

Almost certainly not — the number is the same everywhere, only the rendering differs. Why the result is 8 hours off explains both the timestamp case and the offset-less date string case, which are two different bugs with the same symptom.

Can it turn a date back into a timestamp?

Yes. Paste an ISO 8601 string such as 2026-11-17T06:00:00Z and it gives you the epoch in both seconds and milliseconds. If the string has no Z and no offset, it is read as your local time and the card says so — that assumption is the whole difference between 06:00Z and 14:00+08:00.

Other tools