How timestamps work
Close
A Unix timestamp is the number of seconds that have passed since midnight UTC on 1 January
1970, a moment that is usually called the epoch. The number does not carry a time zone or
a calendar with it, and that is a big part of why computers like to store time this way.
The same number means the same moment wherever in the world it is read, and the time zone
only comes into play when that moment needs to be shown to a person.
Seconds since the epoch 1,000,000,000
That works out to 11,574 days, 1 h 46 min 40 s
Added to 1970-01-01T00:00:00Z, it lands on 2001-09-09T01:46:40Z
Seconds, milliseconds and smaller units
Not every system counts in seconds, though. JavaScript's Date.now() and
Java's System.currentTimeMillis() both count milliseconds, Python's
time.time() gives you seconds with a fractional part, and Go's
UnixNano() counts all the way down to nanoseconds. Because each of those units
is a thousand times smaller than the one before it, you can usually tell which one a
timestamp uses just by counting its digits. For any moment between 2001 and 2286, a
timestamp in seconds has 10 digits, one in milliseconds has 13, one in microseconds has
16, and one in nanoseconds has 19.
This page uses the same trick to work out the unit when you paste in a number. The unit it
picked is shown in the status line under the box, and if the number is some other length,
the status line will tell you that the unit is only a guess. If the guess is wrong, you
can pick the right unit from the buttons that appear underneath.
Writing a moment as text
When a moment needs to be written out as text instead of as a number, the usual choice is
ISO 8601, which looks like 2026-09-28T14:30:00Z. It starts with the date,
has the letter T to separate the date from the time, and ends with the time
zone. A Z at the end means the time is in UTC, while something like
+02:00 means the time is two hours ahead of UTC. Because the largest unit
always comes first, sorting a list of these as plain text also puts them in time order.
Most APIs actually use RFC 3339, which is a stricter version of ISO 8601 that leaves out
some of its less common forms.
When there is no time zone
If a date and time such as 2026-09-28T14:30 does not include a time zone,
there is no way to know exactly which moment it refers to, because half past two in the
afternoon happens at a different moment in every time zone. Even JavaScript is not
consistent about how it handles this. new Date("2026-09-28") treats a date on
its own as UTC, but new Date("2026-09-28T14:30") treats a date with a time as
your local time.
This page reads both of them as UTC, and the status line will point out when it has done
that. If you meant your own local time instead, you can switch to it with the buttons that
appear underneath.
Daylight saving time
In places that use daylight saving time, the clocks jump forward an hour once a year and
go back an hour once a year. That means some local times never happen at all, because the
clock skips right over them, and some happen twice, because the clock runs through the
same hour two times in a row.
If you ask this page to read a local time that was skipped, it uses the offset that was
in effect just before the clocks changed, which is also what most date libraries do. If
you give it a local time that happened twice, it uses the first of the two. The status
line will explain which of these happened.
Some other things worth knowing
Unix time does not count leap seconds. It treats every day as exactly 86,400 seconds
long, so a leap second such as 23:59:60 does not get a number of its own.
This page counts it as the first second of the following minute, which is the same way
Unix time handles it.
A lot of older software stores timestamps as a signed 32-bit number of seconds, and the
latest moment that can hold is 2038-01-19T03:14:07Z. One second after
that, the number overflows and wraps around to a date in December 1901. This is known
as the year-2038 problem, and it can still turn up in old database columns and file
formats.
HTTP headers such as Date, Expires and
Last-Modified use a different format, which looks like
Mon, 28 Sep 2026 14:30:00 GMT. It was originally borrowed from email, and
it can only be precise to the second.
The local times on this page are based on whatever time zone your computer is set to.
The page reads that setting in this tab, and it is never sent anywhere.
Try one billion seconds in the tool