Unix Timestamp Converter
Convert Unix timestamps to human-readable dates and vice versa. Free, instant.
Timestamp → Date
Date → Timestamp
How Unix Timestamps Work
Unix time counts the seconds since the Unix epoch: midnight UTC on 1 January 1970. It is timezone-agnostic — a timestamp represents the same absolute moment in time everywhere on earth. Converting to a human-readable date always requires a timezone offset, which is why the same timestamp shows a different clock time in New York vs London vs Tokyo.
Seconds vs Milliseconds
| Format | Digits | Example | Used in |
|---|---|---|---|
| Seconds | 10 | 1713312000 | Unix shell, Python, MySQL, PostgreSQL |
| Milliseconds | 13 | 1713312000000 | JavaScript Date.now(), Java System.currentTimeMillis() |
| Microseconds | 16 | 1713312000000000 | Python time.time_ns(), high-precision event logs |
Getting Unix Timestamps in Code
| Language | Current timestamp (seconds) |
|---|---|
| JavaScript | Math.floor(Date.now() / 1000) |
| Python | import time; int(time.time()) |
| PHP | time() |
| SQL (MySQL) | UNIX_TIMESTAMP() |
| SQL (PostgreSQL) | EXTRACT(EPOCH FROM NOW())::bigint |
| Go | time.Now().Unix() |
| Rust | SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_secs() |
Why Timestamps Are Better Than Date Strings
Storing dates as Unix timestamps in databases avoids three common bugs: ambiguous date formats (01/02/03 — is that January, February or March?), timezone confusion (storing "2026-05-14 10:00" with no timezone means different things on different servers), and daylight saving time edge cases. Timestamps are an unambiguous integer count. Convert to a human-readable string only at display time, in the user's local timezone.