Unix Timestamps Explained
Developer · Published October 10, 2026 · Updated October 24, 2026 · 3 min read
Written by Akinrinmade Michael
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's one number, so it's 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.
- It's compact and every language can work with it.
Numbers worth recognizing
| Timestamp | Moment in UTC | Why it matters |
|---|---|---|
0 | 1 January 1970, 00:00:00 | The start. Often appears when a date is missing |
1000000000 | 9 September 2001, 01:46:40 | The billionth second |
1700000000 | 14 November 2023, 22:13:20 | A handy sample |
2147483647 | 19 January 2038, 03:14:07 | The last second a signed 32-bit number can hold |
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 tens of thousands of years in the future, it's the other way round.
One moment, many clocks
A timestamp is always UTC. The time zone only matters when you turn it into a readable date. The same number, 1700000000, reads differently depending on where you are:
| Place | Offset in November | Local time |
|---|---|---|
| UTC | +0 | 14 Nov, 22:13:20 |
| London | +0 | 14 Nov, 22:13:20 |
| Lagos | +1 | 14 Nov, 23:13:20 |
| New York | -5 | 14 Nov, 17:13:20 |
| Tokyo | +9 | 15 Nov, 07:13:20 |
Store and send timestamps (or UTC dates), and convert to the local time zone only when you display them. The guide to time zones explains why.
Timestamp or ISO date?
An ISO 8601 date such as 2023-11-14T22:13:20Z is the same moment in a form people can read. Timestamps are better for storage, math and sorting. ISO dates are better for logs, APIs and anything a person might read, and they sort correctly as plain text too. Many systems use both.
Common conversions
JavaScript: new Date(1700000000 * 1000).toISOString() Python: datetime.fromtimestamp(1700000000, timezone.utc) SQL (MySQL): FROM_UNIXTIME(1700000000) Shell: date -u -d @1700000000
Debugging with timestamps
- Count the digits to decide whether it's seconds or milliseconds.
- Convert to UTC and compare with other log lines. A gap of exactly some whole hours between two systems means one of them used local time.
- Check if the value is in the past or the future. An expiry in the past explains most sudden authentication failures.
- If the date is 1970, suspect zero, null, or seconds read as milliseconds.
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. The next second wraps around to a date in 1901. Modern systems use 64-bit numbers, which last for billions of years, but embedded devices, old file formats and old databases can still be affected.
Negative timestamps and leap seconds
Dates before 1970 are negative numbers. Many systems handle them and some don't. Unix time also ignores leap seconds: every day is treated as exactly 86,400 seconds. For almost every application that's 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. The date calculator counts days between dates, the cron explainer shows schedules in UTC, and the JWT decoder turns token timestamps into dates.