What Is Unix Time and How Does a Timestamp Converter Work?
Unix time, also called epoch time or POSIX time, counts the seconds that have passed since 00:00:00 UTC on 1 January 1970. That starting point is the Unix epoch. Because one integer describes any moment, timestamps are easy to store, sort and compare, which is why logs, databases and APIs use them so often.
Unix time ignores leap seconds, so every day counts as exactly 86,400 seconds. For example, 1767225600 is 1 January 2026 at 00:00:00 UTC. Negative numbers are moments before 1970: -86400 is 31 December 1969. This converter turns a timestamp into a readable date, turns a date back into a timestamp, and shows the current Unix time at the top of the page.
Seconds vs Milliseconds
Shell tools, PHP and most databases use seconds, which gives a 10-digit number today. JavaScript and Java use milliseconds, which gives 13 digits. Some tracing and database tools use microseconds (16 digits) or nanoseconds (19 digits). In Auto mode the converter reads up to 11 digits as seconds, 12 to 14 as milliseconds, 15 to 17 as microseconds and 18 or more as nanoseconds. Pick a unit yourself if the guess is wrong.
If a date lands in January 1970, a value in seconds was probably read as milliseconds. If it lands tens of thousands of years from now, a value in milliseconds was read as seconds.
The Year 2038 Problem
Older systems store Unix time in a signed 32-bit integer. The largest value it can hold is 2147483647, which is 03:14:07 UTC on 19 January 2038. One second later the number wraps to -2147483648, which reads as December 1901. Systems with 64-bit timestamps are not affected, since they can count about 292 billion years in either direction. Paste 2147483647 into the converter to see the limit for yourself.
Time Zones and Unix Time
A Unix timestamp has no time zone. It is the same number in Tokyo, London and New York. A time zone only matters when you write the moment as a calendar date. The Timestamp to Date panel shows both UTC and your local time, and the Date to Timestamp panel lets you choose whether the date you enter is local or UTC. The same wall-clock time gives different timestamps in different zones. Store and send timestamps or UTC dates, and convert to local time only when you display them.
Get the Current Timestamp in Code
| Language | Seconds | Milliseconds |
|---|---|---|
| JavaScript | Math.floor(Date.now() / 1000) | Date.now() |
| Python | int(time.time()) | time.time_ns() // 1_000_000 |
| PHP | time() | (int) (microtime(true) * 1000) |
| Java | Instant.now().getEpochSecond() | System.currentTimeMillis() |
| Go | time.Now().Unix() | time.Now().UnixMilli() |
| MySQL | SELECT UNIX_TIMESTAMP(); | SELECT CAST(UNIX_TIMESTAMP(NOW(3)) * 1000 AS UNSIGNED); |
| PostgreSQL | SELECT floor(extract(epoch FROM now())); | SELECT floor(extract(epoch FROM now()) * 1000); |
| Bash | date +%s | date +%s%3N (GNU date) |