What a Unix timestamp is
Unix time counts the seconds that have passed since the "epoch": 00:00:00 UTC on 1 January 1970. So 0 means exactly that moment, and 86,400 (the number of seconds in a day) means 2 January 1970.
Some reference points: 1,000,000,000 is 9 September 2001 at 01:46:40 UTC. 1,700,000,000 is 14 November 2023 at 22:13:20 UTC. 1,767,225,600 is exactly midnight UTC at the start of 1 January 2026.
Because it is just a number counted from a fixed UTC moment, a timestamp means the same instant everywhere in the world. Time zones only matter when you display it to a person.
Seconds or milliseconds?
Different systems use different units. Classic Unix, many databases and JWT claims use seconds. JavaScript's Date.now() and many web APIs use milliseconds, which is 1,000 times larger.
You can tell them apart by size. In 2026, a seconds timestamp has 10 digits (about 1.77 billion) and a milliseconds timestamp has 13 digits (about 1.77 trillion). If you convert a 13-digit value as seconds, you get a date tens of thousands of years in the future, which is a quick sign of the mistake.
Rule of thumb: 10 digits means seconds, 13 digits means milliseconds. Some systems also use microseconds (16 digits) and nanoseconds (19 digits).
Converting to a readable date
- JavaScript: new Date(seconds * 1000).toISOString() gives an ISO 8601 UTC string. Remember to multiply seconds by 1,000.
- Python: datetime.fromtimestamp(seconds, tz=timezone.utc).
- Command line on Linux: date -u -d @1700000000. On macOS: date -u -r 1700000000.
- Spreadsheets: add the number of seconds divided by 86,400 to the date 1 January 1970, then format the cell.
Time zones: the same instant, different clocks
The timestamp 1,700,000,000 is 22:13:20 UTC on 14 November 2023. In India Standard Time (UTC+5:30) the same moment reads 03:43:20 on 15 November 2023. It is the same instant, shown on different clocks, and even the date differs.
Good practice is to store and transmit timestamps in UTC, and convert to the user's time zone only when displaying. Storing local times without the zone is a classic source of bugs around daylight saving changes.
Leap seconds and the Year 2038 problem
Unix time ignores leap seconds: each day is treated as exactly 86,400 seconds, so the count stays simple. That means it is not a perfectly continuous measure of elapsed physical time, which rarely matters for everyday software.
The Year 2038 problem comes from storing the timestamp in a signed 32-bit integer. The largest value is 2,147,483,647, which is 03:14:07 UTC on 19 January 2038. One second later the number overflows and wraps around to a negative value, which many old systems would read as December 1901.
Modern systems use 64-bit timestamps, which will not overflow for about 292 billion years, so the risk is mainly in old embedded systems, legacy databases and file formats that still use 32 bits.
Frequently asked questions
What is the epoch?
The starting point of Unix time: 00:00:00 UTC on 1 January 1970. A timestamp is the number of seconds since then.
Does a Unix timestamp depend on the time zone?
No. It identifies one instant in time everywhere. Time zones only affect how that instant is displayed as a local date and time.
Can a timestamp be negative?
Yes. Negative values represent moments before 1970. For example, −86,400 is 31 December 1969.
How do I get the current timestamp?
In JavaScript, Math.floor(Date.now() / 1000) gives seconds. In Python, int(time.time()). Most databases and command lines also have a function for it.
Try these tools
Unix Timestamp Converter
Convert Unix timestamps (seconds or milliseconds) to human-readable dates and back. Shows UTC, ISO 8601 and local time. Live current epoch.
Open toolDate Difference Calculator
Find the number of days, weeks, months and years between two dates, count business days, or add and subtract days, weeks, months or years from a date.
Open toolTime Zone Converter
Pick a date and time in any IANA time zone and see it in several other zones at once. Daylight saving aware, with 12 or 24-hour display. Free, private.
Open toolJWT Decoder
Decode a JWT to read its header, payload and expiry time. Free and runs locally, so your token is never sent to a server.
Open toolKeep reading
How to verify web design files
How to verify web design files before you accept, publish or hand them off: check they arrived intact, nothing is missing, the code is valid, images are right and the build matches the design.
Read guideHow JSON Web Tokens work, and how to read one safely
Understand the three parts of a JSON Web Token, why the payload is readable by anyone, what the signature actually protects, and how to inspect a token without leaking it.
Read guideBase64 explained: how it works, with examples
Understand Base64 encoding with worked examples ("Man" becomes TWFu), why it makes data 33% bigger, what the = padding means, and why Base64 is not encryption.
Read guide