Unix Timestamp Converter
Convert epoch time to human-readable dates and back β supports seconds and milliseconds
What is a Unix Timestamp?
A Unix timestamp (also called epoch time or POSIX time) is the number of seconds that have elapsed since January 1, 1970, 00:00:00 UTC β a reference point known as the Unix Epoch. It is the most widely used system for representing time in computing.
Because Unix timestamps are a simple integer, they are timezone-independent, easy to store, sort, and compare, and supported universally across programming languages and databases.
Seconds vs. Milliseconds
Classic Unix timestamps count seconds. JavaScript's Date.now() and many modern APIs return milliseconds (multiply seconds by 1,000). This converter auto-detects which you have: values larger than 10,000,000,000 (10 billion) are treated as milliseconds.
Get the current timestamp
| Language / Tool | Seconds | Milliseconds |
|---|---|---|
| JavaScript | Math.floor(Date.now()/1000) | Date.now() |
| Python | import time; int(time.time()) | int(time.time()*1000) |
| PHP | time() | round(microtime(true)*1000) |
| Bash | date +%s | date +%s%3N |
| MySQL | UNIX_TIMESTAMP() | β |
| PostgreSQL | extract(epoch from now())::int | β |
| Go | time.Now().Unix() | time.Now().UnixMilli() |
| Ruby | Time.now.to_i | Time.now.to_i * 1000 |