Databases, APIs, logs and JWT tokens often store time as a single number like 1773480600. That number is a Unix timestamp: the number of seconds since 1 January 1970 at 00:00:00 UTC. It is simple, compact and the same everywhere in the world – but it is not readable until you convert it.
Page Contents
Why 1970?
The “Unix epoch” – 1970-01-01T00:00:00Z – was chosen by the early Unix developers as a convenient starting point. Every moment is counted from it; dates before 1970 are negative numbers.
Seconds or milliseconds?
| Digits (today) | Unit | Common in |
|---|---|---|
| 10 | Seconds | Unix, PHP, Python time.time(), most APIs, JWT exp |
| 13 | Milliseconds | JavaScript Date.now(), Java/Kotlin System.currentTimeMillis() |
| 16 | Microseconds | Some databases and logs |
If a date converts to January 1970 or to a year far in the future, you probably mixed up seconds and milliseconds. Our converter detects the unit automatically.
Time zones
A Unix timestamp has no time zone – it is always UTC. Time zones only matter when you display it. The same timestamp is 09:30 in London and 15:00 in New Delhi. Store timestamps (or UTC dates) and convert to local time only for display.
Converting in code
| Language | Now (seconds) | Timestamp to date |
|---|---|---|
| JavaScript | Math.floor(Date.now() / 1000) | new Date(ts * 1000) |
| Python | int(time.time()) | datetime.fromtimestamp(ts, timezone.utc) |
| Kotlin / Java | Instant.now().epochSecond | Instant.ofEpochSecond(ts) |
| PHP | time() | date('Y-m-d H:i:s', $ts) |
| MySQL | UNIX_TIMESTAMP() | FROM_UNIXTIME(ts) |
| PostgreSQL | extract(epoch from now()) | to_timestamp(ts) |
The year 2038 problem
Systems that store timestamps as signed 32-bit integers can only count up to 2,147,483,647 – which is reached at 03:14:07 UTC on 19 January 2038. After that the number overflows. Modern systems use 64-bit integers, which last for billions of years, but old embedded devices and databases may still need updates.
Leap seconds
Unix time ignores leap seconds – every day is exactly 86,400 seconds. That keeps calculations simple and is fine for almost all applications.
Where you will see timestamps
- API responses and webhooks
- Log files
- JWT claims such as exp and iat – decode them with our JWT Decoder
- Cron jobs and schedulers – see the cron expression guide
- Database columns like created_at
FAQ
What is the current Unix timestamp?
Open the converter – it shows a live epoch clock.
How do I know if a timestamp is in seconds or milliseconds?
Today, 10 digits usually means seconds and 13 digits means milliseconds.
Is a Unix timestamp in UTC?
Yes. It counts seconds since 1 January 1970 UTC and has no time zone.
Can Unix timestamps be negative?
Yes. Negative values represent dates before 1970.
What happens in 2038?
Systems using signed 32-bit timestamps overflow on 19 January 2038. 64-bit systems are not affected.
Need a website or app for your business? Talk to Techpass Master – we design and build websites and apps for clients worldwide.
