Convert epoch time to human-readable dates and back. Supports seconds and milliseconds. Runs entirely in your browser.
A Unix timestamp (also called epoch time or POSIX time) is the number of seconds that have elapsed since January 1, 1970, at 00:00:00 UTC — known as the Unix epoch. It's a universal, timezone-independent way to represent a specific point in time.
Unix timestamps are the backbone of how computers store and compare dates. When you see a number like 1742342400, that's a specific moment in time that any computer can decode unambiguously, regardless of locale or timezone.
Timestamps come in two common forms:
1742342400). Standard in Unix/Linux, C, Go, Python's time.time().1742342400000). Used in JavaScript (Date.now()), Java, and most web APIs.This converter auto-detects which format you're using based on the number of digits.
| Event | Unix Timestamp (s) | Date (UTC) |
|---|---|---|
| Unix Epoch | 0 | 1970-01-01 00:00:00 |
| Y2K | 946684800 | 2000-01-01 00:00:00 |
| Billion seconds | 1000000000 | 2001-09-09 01:46:40 |
| Y2K38 problem | 2147483647 | 2038-01-19 03:14:07 |
| 2 billion seconds | 2000000000 | 2033-05-18 03:33:20 |
| Language / Tool | Seconds | Milliseconds |
|---|---|---|
| JavaScript | Math.floor(Date.now()/1000) | Date.now() |
| Python | import time; int(time.time()) | int(time.time()*1000) |
| Go | time.Now().Unix() | time.Now().UnixMilli() |
| Bash | date +%s | date +%s%3N |
| SQL (PostgreSQL) | EXTRACT(epoch FROM NOW()) | n/a (use now()) |
| SQL (MySQL) | UNIX_TIMESTAMP() | n/a |
| PHP | time() | round(microtime(true)*1000) |
| Ruby | Time.now.to_i | Time.now.to_i * 1000 |
| Java | System.currentTimeMillis()/1000 | System.currentTimeMillis() |
| C# | DateTimeOffset.UtcNow.ToUnixTimeSeconds() | DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() |
The "Year 2038 Problem" (Y2K38) is a known issue for 32-bit systems. Because 32-bit signed integers can only store values up to 2,147,483,647, they'll overflow on January 19, 2038 at 03:14:07 UTC. Systems still using 32-bit time_t (mostly legacy embedded systems and old Linux kernels) will interpret that moment as 1901-12-13. Modern 64-bit systems are immune — a 64-bit timestamp won't overflow for 292 billion years.
Timestamps can be negative — they represent moments before the Unix epoch (before 1970). For example, -86400 is December 31, 1969, 00:00:00 UTC. Not all systems handle negative timestamps correctly, but modern JavaScript, Python, and Go all support them.
Date.now() to provide sub-second precision without floating point. The C standard (and Unix in general) used seconds because millisecond precision wasn't needed in the 1970s. Both choices made sense at the time.new Date(ts * 1000).toLocaleString('en-US', {timeZone: 'America/New_York'}).YYYY-MM-DDTHH:mm:ssZ where Z means UTC. For example: 2024-03-19T12:00:00Z. It's sortable, unambiguous, and widely supported. Use it for logs, APIs, and data storage whenever possible.