Unix timestamps explained: seconds, milliseconds and time zones
What a Unix timestamp is, how to tell seconds from milliseconds, why dates come out a day wrong, and the year 2038 problem — with examples you can check.
Published
Tools for this job: Timestamp Converter · Time Converter · Time Zone Meeting Planner
Logs, databases and APIs are full of numbers like 1700000000. They are Unix timestamps — the most common way computers record a moment in time — and once you know the rules they are easy to read.
What a Unix timestamp is
A Unix timestamp counts the seconds since midnight UTC on 1 January 1970, a moment known as the Unix epoch. It has no time zone of its own: the same number means the same instant everywhere on Earth. That is exactly why systems store time this way — and convert to local time only when showing it to a person.
Some timestamps to recognise
| Timestamp | Moment (UTC) |
|---|---|
| 0 | 1 January 1970, 00:00:00 |
| 1,000,000,000 | 9 September 2001, 01:46:40 |
| 1,700,000,000 | 14 November 2023, 22:13:20 |
| 2,000,000,000 | 18 May 2033, 03:33:20 |
| 2,147,483,647 | 19 January 2038, 03:14:07 |
Paste any of them into the Timestamp Converter to see the date in UTC and in your own time zone side by side.
Seconds or milliseconds?
Count the digits of a present-day timestamp:
- 10 digits — seconds. Used by Unix tools, most databases and many APIs.
- 13 digits — milliseconds. Used by JavaScript, Java and many web APIs.
- 16 digits — microseconds, used by some databases and logging systems.
Read a millisecond value as seconds and you land tens of thousands of years in the future; read a seconds value as milliseconds and you land in January 1970. Both are common bugs, and the converter detects the unit from the size of the number and says which it assumed.
Why a date comes out one day wrong
A timestamp is an instant; a calendar date depends on where you are. 23:30 on the 5th in UTC is already the 6th in Asia and still the 5th in the Americas. If a date displays a day off, it is almost always being shown in a different time zone from the one it was recorded in. The fix is to decide explicitly which zone a date belongs to — store in UTC, convert at display time — rather than letting each system use its own default.
Getting the current timestamp
- JavaScript:
Math.floor(Date.now() / 1000)for seconds;Date.now()for milliseconds. - Python:
int(time.time()). - Linux or macOS terminal:
date +%s.
Writing dates for people and logs
When a date has to be readable, use the ISO 8601 format, such as 2026-10-01T09:30:00Z. The Z means UTC; an offset such as +05:30 can be written instead. ISO dates sort correctly as text and are unambiguous, unlike 03/04/2026, which means different days in different countries.
Leap seconds and negative timestamps
Unix time ignores leap seconds: every day is treated as exactly 86,400 seconds. Dates before 1970 are negative numbers, which most modern systems handle but some older ones do not.
The year 2038 problem
Systems that store a timestamp in a signed 32-bit integer can count only up to 2,147,483,647 — 19 January 2038 at 03:14:07 UTC. One second later the number overflows. Modern platforms use 64-bit values and are unaffected, but the limit still turns up in older software, embedded devices and data formats, which is why it is worth checking any system expected to run past 2038.
Related tools
To convert a duration rather than a moment — seconds to hours, days to minutes — use the Time Converter. To find a meeting time across several real time zones, with daylight saving handled, use the Time Zone Meeting Planner.