Unix Time Guide
A shared starting point for time
The Unix epoch is January 1, 1970, at 00:00:00 UTC. Counting from this fixed point makes it easy to store, compare and exchange instants across applications. The number 1704067200, for example, represents January 1, 2024 at midnight UTC.
Enter a timestamp and its unit will be detected automatically from its magnitude. The result displays the detected format alongside the ISO 8601 date. Microsecond and nanosecond fractions are preserved in the ISO result; the browser’s local time display is limited to millisecond precision.
Get the current timestamp in code
JavaScript · seconds
Math.floor(Date.now() / 1000)Python · seconds
import time
int(time.time())PostgreSQL · seconds
SELECT EXTRACT(EPOCH FROM NOW());Choose units deliberately
One second is 1,000 milliseconds, 1,000,000 microseconds or 1,000,000,000 nanoseconds. Nanosecond timestamps can exceed JavaScript’s safe integer range. This toolkit uses integer arithmetic to preserve the input digits.
Time units
Common durations in seconds and milliseconds.
| Duration | Seconds | Milliseconds |
|---|---|---|
| 1 minute | 60 | 60,000 |
| 1 hour | 3,600 | 3,600,000 |
| 1 day | 86,400 | 86,400,000 |
| 1 week | 604,800 | 604,800,000 |
Calendar months and years have variable lengths.
What is a Unix timestamp?+
A Unix timestamp counts seconds since January 1, 1970 at 00:00:00 UTC. A timestamp identifies the same instant worldwide; a time zone changes how that instant is displayed. Unix time does not count leap seconds.
Are timestamps in seconds or milliseconds?+
Both are common. Contemporary timestamps usually have 10 digits in seconds and 13 in milliseconds. Microseconds use 16 and nanoseconds use 19. PlainUtils detects units by magnitude: up to 10 digits means seconds, 11–13 milliseconds, 14–16 microseconds, and 17 or more nanoseconds, ignoring the minus sign and leading zeros. This is a heuristic: values close to 1970 or very distant dates can be ambiguous. The detected unit is always shown with the result.
Can I convert dates before 1970?+
Yes. Negative timestamps represent instants before the Unix epoch. For example, -1 second is December 31, 1969 at 23:59:59 UTC.
What happens in the year 2038?+
Signed 32-bit systems run out of representable Unix seconds after January 19, 2038 at 03:14:07 UTC. This is a limitation of that integer representation, not Unix time itself. Systems using larger representations can continue beyond 2038.
How are time zones handled?+
Timestamp results use UTC. Your browser can also show your local time. When converting a date, select its UTC offset explicitly. A fixed offset does not calculate daylight saving transitions; use the offset that applies on your chosen date.