Epoch Converter — Unix Timestamp to Date & Date to Epoch
Convert Unix timestamps to human-readable dates or any date to epoch time. Supports seconds, milliseconds, microseconds, and nanoseconds. Current timestamp updates live.
What Is Unix Epoch Time?
The Unix epoch is January 1, 1970 at 00:00:00 UTC. A Unix timestamp is the total number of seconds elapsed since that moment. It is the universal way computers store time as a single integer — independent of timezone, locale, or calendar system. At the time of writing, the current Unix timestamp is over 1.78 billion seconds. The 2-billion-second milestone will occur on May 18, 2033.
Seconds vs Milliseconds vs Microseconds
Unix timestamps are traditionally in seconds (10 digits). JavaScript's Date.now() returns milliseconds (13 digits). Some databases and APIs use microseconds (16 digits) or nanoseconds (19 digits). The auto-detect mode above identifies the unit by digit count. If a timestamp looks wrong, try switching the unit manually.
Get the Current Epoch in Code
| Language | Current epoch (seconds) | Convert epoch to date |
|---|---|---|
| JavaScript | Math.floor(Date.now() / 1000) | new Date(epoch * 1000).toISOString() |
| Python | import time; int(time.time()) | datetime.fromtimestamp(epoch) |
| PHP | time() | date('Y-m-d H:i:s', epoch) |
| Java | System.currentTimeMillis() / 1000L | new Date(epoch * 1000L) |
| Go | time.Now().Unix() | time.Unix(epoch, 0) |
| Ruby | Time.now.to_i | Time.at(epoch) |
| C# | DateTimeOffset.Now.ToUnixTimeSeconds() | DateTimeOffset.FromUnixTimeSeconds(epoch) |
| MySQL | SELECT UNIX_TIMESTAMP(NOW()) | SELECT FROM_UNIXTIME(epoch) |
| PostgreSQL | SELECT EXTRACT(EPOCH FROM now()) | SELECT TO_TIMESTAMP(epoch) |
| Bash | date +%s | date -d @epoch |
Year 2038 Problem
Systems that store Unix timestamps as a signed 32-bit integer will overflow on January 19, 2038 at 03:14:07 UTC (timestamp 2,147,483,647). After that, the value wraps to a large negative number, causing dates to appear as 1901. Modern 64-bit systems don't have this problem — a 64-bit Unix timestamp can represent dates billions of years into the future. Most current systems have been updated, but legacy embedded systems, old databases, and older languages may still be affected.
new Date(timestamp * 1000).toISOString() (multiply by 1000 to convert seconds to ms first).