Ten digits or thirteen
Every "my timestamp is wrong by fifty thousand years" bug is the same bug: a value in milliseconds read as seconds, or the other way around. Both counters start at the same moment, so they differ only by a factor of 1,000 — and the difference between them is, at this scale, a geological era.
The length gives it away. Right now a Unix timestamp in seconds has 10 digits and one in milliseconds has 13. Read a 13-digit value as seconds and you land tens of thousands of years in the future; read a 10-digit value as milliseconds and you land in January 1970. Neither error throws an exception, which is why it survives to production.
Where each one comes from is worth memorizing, because the language you are in decides the unit:
- Seconds: PHP
time(), Pythontime.time(), Gotime.Now().Unix(), MySQLUNIX_TIMESTAMP(), most REST APIs. - Milliseconds: JavaScript
Date.now()andgetTime(), JavaSystem.currentTimeMillis(), Android, .NETDateTimeOffset.ToUnixTimeMilliseconds().
Both counters reached their current digit count on the same day: 9 September 2001 at 01:46:40 UTC, when the seconds count passed 1,000,000,000 and the milliseconds count passed 1,000,000,000,000. The seconds counter keeps ten digits until 2286.
The 2038 boundary
Signed 32-bit integers stop at 2,147,483,647, and a system that stores a Unix timestamp in one runs out on 19 January 2038 at 03:14:07 UTC. One second later the value overflows to the most negative number the type can hold, which decodes to 13 December 1901 at 20:45:52 UTC. That is the whole 2038 problem: not a wrong date, but a date that jumps backwards by 137 years.
Most current systems already store timestamps in 64-bit integers, which pushes the equivalent boundary to the year 292,277,026,596. The ones that have not are usually embedded: firmware, industrial controllers, old database columns, a file format someone wrote in 2004. If you are choosing a column type today, the choice costs nothing now and is very expensive later.
Time zones are not part of the timestamp
A Unix timestamp is a single number naming one instant. It carries no time zone, no calendar and no daylight saving rule; those are applied when the number is turned into text. That is why the same value is 21:24 in UTC and 05:24 the next morning in Tokyo, and why the value does not change when you cross a border.
Three traps follow from that:
- EST is not EDT. The search suggestions for
utc to estinclude both-4and-5, and both are right in their season. Eastern Standard Time is UTC−5; Eastern Daylight Time is UTC−4. A page that prints "EST" for July is printing the wrong label even when the arithmetic is right. - IST is three different zones. India Standard Time is UTC+5:30, Irish Standard Time is UTC+1, Israel Standard Time is UTC+2. Half-hour offsets exist and are not a rounding error — India and Newfoundland both use them.
- DST is a local rule, not an offset. Countries switch on different dates and some do not switch at all, so "add five hours" is only correct until the last Sunday of March or October, depending on where you are.
Here is the whole idea in one value. The timestamp 1700000000 is 14 November 2023, 22:13:20 in UTC. In Berlin that is 23:13:20 the same evening, in New York 17:13:20 the same afternoon, and in Tokyo 07:13:20 the next morning. Four renderings, one number, no contradiction — and none of them is more correct than the others.
This converter avoids the labels and shows UTC plus the time zone your browser reports. Two unambiguous renderings beat one labeled guess.
The practical rule that follows: store the number, render the text. Servers keep UTC and convert at the edge, because a server that stores local time and then moves data centre is storing a fact about its old location rather than about the event.
ISO 8601, and what the Z means
2026-11-23T21:24:39Z and 2026-11-23T21:24:39+08:00 are two spellings of the same format. The T separates date from time, and the Z is a zero offset — Zulu in the old radio alphabet, meaning UTC. An offset such as +08:00 does the same job for a local time.
The version people get wrong is 2026-11-23 21:24:39 with no zone at all. Every parser has to guess, and different languages guess differently: JavaScript treats a date-time string without a zone as local time, while a date-only string as UTC. That inconsistency is worth knowing before you decide a timestamp is corrupted.
There is also a compact form with no separators — 20261123T212439Z — which is legal ISO 8601 and shows up in filenames and in older APIs. It is the same instant as the version with dashes and colons; only the punctuation is missing.
Leap seconds, and why the count is clean
Unix time treats every day as exactly 86,400 seconds. Real days are not: UTC occasionally gets a leap second inserted to stay within a second of the Earth's rotation, and 27 of them have been added since 1972, the last at the end of 2016. Because Unix time counts seconds and ignores those insertions, a Unix timestamp and a UTC clock can differ by that handful of seconds. For scheduling, logs and ordinary arithmetic it never matters; for anything that has to line up with a time standard, it does.
Nothing leaves the tab
Timestamps from logs, tokens and database rows are the kind of value people paste without thinking, and an epoch value plus a URL is sometimes enough to identify a record. The conversion here runs in JavaScript on this page: no value is sent to a server, nothing is logged, and nothing is stored between visits.