Unix Timestamps Explained
Developer · October 10, 2026 · 2 min read
A Unix timestamp, also called epoch time, is a single number that identifies a moment in time. It counts the seconds since 1 January 1970 at 00:00:00 UTC, a date known as the Unix epoch. For example, 1700000000 is 14 November 2023 at 22:13:20 UTC.
Why developers like it
- It is one number, so it is easy to store, sort and compare.
- It has no time zone, so it means the same moment everywhere.
- Subtracting two timestamps gives the time between them in seconds.
Seconds or milliseconds?
Different systems use different units, and mixing them up is a very common bug:
- 10 digits (such as
1700000000) are usually seconds: Unix, most databases, JWT claims likeexpandiat. - 13 digits (such as
1700000000000) are usually milliseconds: JavaScript'sDate.now()and Java. - 16 digits are microseconds and 19 digits are nanoseconds, used by some databases and Go.
If a date shows up as January 1970, you probably gave seconds to something that expected milliseconds. If it lands in the year 55,000, it is the other way round.
Time zones
A timestamp is always UTC. The time zone only matters when you turn it into a readable date. The same timestamp is 22:13 in London and 17:13 in New York. Store and send timestamps (or UTC dates), and convert to the local time zone only when you display them.
Common conversions
JavaScript: new Date(1700000000 * 1000).toISOString() Python: datetime.fromtimestamp(1700000000, timezone.utc) SQL (MySQL): FROM_UNIXTIME(1700000000) Shell: date -u -d @1700000000
The Year 2038 problem
Old systems store the timestamp in a signed 32-bit integer, which runs out on 19 January 2038 at 03:14:07 UTC. Modern systems use 64-bit numbers, which last for billions of years, but embedded devices and old databases can still be affected.
Leap seconds
Unix time ignores leap seconds: every day is treated as exactly 86,400 seconds. For almost every application that is exactly what you want.
Paste any number into the Unix Timestamp Converter to see it as a date in any time zone, or go the other way from a date to a timestamp.