Unix Timestamps Explained
By Aravind Jagarlamudi · Updated November 19, 2026 · 4 min read
If you work with software, sooner or later you'll meet a number like 1767225600 and need to know what date it represents. That number is a Unix timestamp, and it's the most common way computers store a moment in time. This guide explains what it is, why it's used, and the pitfalls to watch out for.
What a Unix timestamp is
A Unix timestamp (also called epoch time or POSIX time) is the number of seconds that have passed since 00:00:00 UTC on 1 January 1970, a moment known as the Unix epoch.
0is 1 January 1970, 00:00:00 UTC86400is 2 January 1970, 00:00:00 UTC (one day = 86,400 seconds)1000000000was 9 September 2001, 01:46:40 UTC1767225600is 1 January 2026, 00:00:00 UTC
Negative numbers represent dates before 1970.
You can convert any timestamp to a readable date — and back — with the Unix Timestamp Converter.
Why computers use it
It has no time zone. A Unix timestamp refers to a single instant everywhere on Earth. 1767225600 is midnight on New Year's Day in London, 7 PM on New Year's Eve in New York, and 5:30 AM on New Year's Day in Mumbai — all at the same time. Time zones only come in when you display it to a person.
It ignores daylight saving time. Because it is based on UTC, there are no skipped or repeated hours. Every second has exactly one timestamp.
It's easy to compare and calculate with. Want to know how long ago something happened? Subtract two numbers. Want to sort events? Sort integers. No parsing of months, days, or leap years required.
It's compact. A single 64-bit integer is smaller and faster than a text date like "2026-01-01T00:00:00Z".
Seconds vs milliseconds
Not every system counts in seconds:
| System | Unit | Example for 1 Jan 2026 00:00 UTC |
|---|---|---|
Unix / POSIX, Python time.time(), most databases | seconds | 1767225600 |
JavaScript Date.now(), Java System.currentTimeMillis() | milliseconds | 1767225600000 |
| Some logging and tracing systems | microseconds or nanoseconds | 1767225600000000 |
A quick rule of thumb: a current timestamp in seconds has 10 digits, in milliseconds 13 digits. If a date shows up as being in the year 57,000, you've probably treated milliseconds as seconds. If it shows up as January 1970, you've probably done the reverse.
Leap seconds
UTC has occasionally inserted leap seconds to stay in step with the Earth's rotation. Unix time does not count them — it pretends every day is exactly 86,400 seconds long. During a leap second, systems typically repeat a second or "smear" the extra second across several hours. For almost all applications this doesn't matter, and leap seconds are scheduled to be abolished by 2035.
The Year 2038 problem
Many older systems stored Unix time as a signed 32-bit integer, which can hold values up to 2,147,483,647. That limit is reached at 03:14:07 UTC on 19 January 2038. One second later, a 32-bit counter overflows and wraps around to a negative number representing December 1901.
Modern operating systems, languages and databases use 64-bit timestamps, which won't overflow for roughly 292 billion years. But embedded devices, old file formats and legacy databases can still be affected, so it is worth checking if you maintain long-lived systems.
Common pitfalls
- Converting to local time on the server. Store and transmit timestamps in UTC; convert to the user's time zone only for display.
- Assuming "a day" is 86,400 seconds in local time. It is in Unix time, but a local calendar day can be 23 or 25 hours long on daylight saving changeover days. Use a date library when adding "one day" in a user's time zone.
- Mixing seconds and milliseconds between a JavaScript front end and a Python or SQL back end.
- Parsing text dates without a zone. "2026-03-08 02:30" doesn't exist in New York (clocks skip from 2:00 to 3:00 that night). Always attach a zone or offset.
Converting in code
// JavaScript: seconds → Date
new Date(1767225600 * 1000).toISOString(); // "2026-01-01T00:00:00.000Z"
// Date → seconds
Math.floor(Date.now() / 1000);
# Python
from datetime import datetime, timezone
datetime.fromtimestamp(1767225600, tz=timezone.utc) # 2026-01-01 00:00:00+00:00
int(datetime.now(timezone.utc).timestamp())
-- PostgreSQL
SELECT to_timestamp(1767225600); -- timestamptz
SELECT extract(epoch FROM now())::bigint;
Summary
A Unix timestamp is the count of seconds since 1 January 1970 UTC. It is time-zone-free, unaffected by daylight saving, and easy to compute with, which is why nearly every computer system uses it under the hood. Watch out for the seconds/milliseconds mix-up, convert to local time only at display, and make sure anything long-lived uses 64-bit storage.