What is Unix time?
Unix time counts the seconds elapsed since 00:00:00 UTC on 1 January 1970 (the "epoch"), ignoring leap seconds. JavaScript, Java and many APIs use milliseconds instead, giving 13-digit values.
Notable timestamps
| Seconds | UTC date | Why it matters |
|---|---|---|
| 0 | 1970-01-01 00:00:00 | The epoch |
| 1,000,000,000 | 2001-09-09 01:46:40 | First 10-digit time |
| 1,700,000,000 | 2023-11-14 22:13:20 | Round number |
| 2,000,000,000 | 2033-05-18 03:33:20 | Next round billion |
| 2,147,483,647 | 2038-01-19 03:14:07 | Max signed 32-bit: the Year 2038 problem |
Get the timestamp in code
JavaScript Math.floor(Date.now() / 1000) Python import time; int(time.time()) PHP time() Bash date +%s SQL (Postgres) SELECT extract(epoch FROM now()); Go time.Now().Unix()