What is Unix epoch time?
A Unix timestamp counts the seconds since 00:00:00 UTC on 1 January 1970 (the "epoch"), ignoring leap seconds. It is the same everywhere in the world, so it is handy for logs, databases and APIs. JavaScript and many APIs use milliseconds instead — 13 digits rather than 10.
The converter detects the unit from the number of digits: up to 11 → seconds, 12–14 → milliseconds, 15–17 → microseconds, more → nanoseconds.
Frequently asked questions
How do I get the current epoch time in code?
JavaScript: Math.floor(Date.now() / 1000). Python: int(time.time()). Shell: date +%s. PHP: time().
Is a Unix timestamp in UTC?
Yes. A timestamp is time-zone independent; converting it to a date needs a time zone, which is why both local and UTC are shown.
How do I tell if a timestamp is seconds or milliseconds?
Current timestamps in seconds have 10 digits; in milliseconds they have 13.