What is a Unix timestamp?
Unix time (also called epoch time or POSIX time) counts the number of seconds since 1970-01-01 00:00:00 UTC, the “Unix epoch”. Because it is a single number that does not depend on time zones or daylight saving time, it is used everywhere in software: databases, log files, HTTP APIs, cookies, and the exp / iat claims of a JWT.
| Unix timestamp | Date (UTC) |
|---|---|
0 | 1970-01-01 00:00:00 |
1000000000 | 2001-09-09 01:46:40 |
1700000000 | 2023-11-14 22:13:20 |
2000000000 | 2033-05-18 03:33:20 |
2147483647 | 2038-01-19 03:14:07 (max signed 32-bit value) |
-1 | 1969-12-31 23:59:59 |
Seconds or milliseconds?
Present-day timestamps are 10 digits in seconds and 13 digits in milliseconds. JavaScript's Date.now() and Java's System.currentTimeMillis() return milliseconds; PHP's time(), Python's int(time.time()), Go's time.Now().Unix() and date +%s return seconds. This tool reads up to 11 digits as seconds, up to 14 as milliseconds, up to 17 as microseconds and anything longer as nanoseconds.
Get and convert Unix time in code
| Language | Current timestamp (seconds) | Timestamp → date |
|---|---|---|
| JavaScript | Math.floor(Date.now() / 1000) | new Date(ts * 1000).toISOString() |
| Python | int(time.time()) | datetime.fromtimestamp(ts, tz=timezone.utc) |
| PHP | time() | gmdate('c', $ts) |
| Java | Instant.now().getEpochSecond() | Instant.ofEpochSecond(ts) |
| Go | time.Now().Unix() | time.Unix(ts, 0).UTC() |
| Linux (GNU date) | date +%s | date -u -d @1700000000 |
| macOS (BSD date) | date +%s | date -u -r 1700000000 |
| PostgreSQL | extract(epoch from now()) | to_timestamp(1700000000) |
| MySQL | UNIX_TIMESTAMP() | FROM_UNIXTIME(1700000000) |
Frequently asked questions
Why is my converted time off by several hours?
A Unix timestamp is always relative to UTC. If you read it as UTC but expected local time (or the other way round), the result is off by exactly your UTC offset — for example 5 hours for US Eastern Standard Time. Check the timezone selected above; the result list also shows UTC and your browser's local time side by side.
What is the Year 2038 problem?
Systems that store Unix time in a signed 32-bit integer can count only up to 2147483647, which is 2038-01-19 03:14:07 UTC. One second later the value overflows and wraps around to 1901-12-13 20:45:52 UTC. Using a 64-bit integer avoids the problem; most modern platforms already do.
How is the timezone handled when I enter a date?
A date without an offset, such as 2026-10-04 12:00:00, is read in the selected timezone. A date with an explicit offset, such as 2026-10-04T12:00:00Z or 2026-10-04T12:00:00+09:00, uses that offset instead.
Does Unix time include leap seconds?
No. Unix time assumes every day has exactly 86,400 seconds and ignores leap seconds, so this tool gives the same results as standard programming libraries.