ES
Convert epoch seconds or milliseconds to a readable date — and any date back to a Unix timestamp — with copy-paste code for 10 languages.
A Unix timestamp is the number of seconds elapsed since January 1, 1970 at 00:00:00 UTC (the "Unix epoch"). Right now that number is around 1.78 billion. Timestamps in seconds have 10 digits until the year 2286; values with 13 digits are milliseconds. Paste any value below to get the exact date in UTC and your local time zone.
A Unix timestamp (also called epoch time, POSIX time or Unix time) is a single integer that counts the seconds since 00:00:00 UTC on January 1, 1970. That starting point is the Unix epoch.
Because it is one number with no time zone, no daylight-saving rules and no calendar format, it is the standard way computers store and exchange moments in time:
| Where you'll see it | Example |
|---|---|
| API responses (JSON) | "created_at": 1782950400 |
| Database columns | MySQL INT/TIMESTAMP, PostgreSQL to_timestamp() |
| Log files | [1782950400] GET /index.html 200 |
| JWT tokens | "exp": 1782954000 (expiry) |
| Cookies and cache headers | Expires, max-age calculations |
Negative timestamps are valid too: they represent dates before 1970. For example, -86400 is December 31, 1969 at 00:00 UTC.
The most common conversion bug: mixing up units. The rule of thumb in 2026 is the digit count:
| Digits | Unit | Example | Used by |
|---|---|---|---|
| 10 | Seconds | 1782950400 | Unix/Linux, PHP, Python, MySQL, most APIs |
| 13 | Milliseconds | 1782950400000 | JavaScript Date.now(), Java, MongoDB |
| 16 | Microseconds | 1782950400000000 | Some databases, high-precision logs |
| 19 | Nanoseconds | 1782950400000000000 | Go time.UnixNano(), system tracing |
If you convert a 13-digit value as seconds you'll get a date 56,000+ years in the future. If you convert a 10-digit value as milliseconds you'll land in January 1970. Both are instantly recognizable signs of a unit mismatch — divide or multiply by 1,000 to fix it. This tool auto-detects the unit from the digit count.
Handy reference values (all UTC):
| Timestamp | Date (UTC) | Meaning |
|---|---|---|
0 | 1970-01-01 00:00:00 | The Unix epoch |
1000000000 | 2001-09-09 01:46:40 | 1 billion seconds |
1500000000 | 2017-07-14 02:40:00 | 1.5 billion |
1750000000 | 2025-06-15 15:06:40 | 1.75 billion |
2000000000 | 2033-05-18 03:33:20 | 2 billion |
2147483647 | 2038-01-19 03:14:07 | 32-bit signed limit ("Y2038") |
And the arithmetic you use daily:
| Period | Seconds |
|---|---|
| 1 hour | 3,600 |
| 1 day | 86,400 |
| 1 week | 604,800 |
| 30 days | 2,592,000 |
| 365 days | 31,536,000 |
// JavaScript — Date.now() returns milliseconds!
Math.floor(Date.now() / 1000) // seconds
# Python
import time
int(time.time())
// PHP
time();
-- MySQL
SELECT UNIX_TIMESTAMP();
-- PostgreSQL
SELECT EXTRACT(EPOCH FROM NOW())::int;
// Java
Instant.now().getEpochSecond();
// Go
time.Now().Unix()
// C#
DateTimeOffset.UtcNow.ToUnixTimeSeconds();
# Ruby
Time.now.to_i
# Bash / Linux
date +%s
// Swift
Int(Date().timeIntervalSince1970)
// JavaScript — multiply seconds by 1000
new Date(1782950400 * 1000).toISOString()
// "2026-07-01T00:00:00.000Z"
# Python — UTC-aware (recommended)
from datetime import datetime, timezone
datetime.fromtimestamp(1782950400, tz=timezone.utc)
-- MySQL
SELECT FROM_UNIXTIME(1782950400);
-- PostgreSQL
SELECT to_timestamp(1782950400);
// PHP
date('Y-m-d H:i:s', 1782950400); // server time zone
gmdate('Y-m-d H:i:s', 1782950400); // UTC
And the reverse, date to timestamp:
// JavaScript
Math.floor(new Date('2026-07-01T00:00:00Z').getTime() / 1000)
# Python
from datetime import datetime, timezone
int(datetime(2026, 7, 1, tzinfo=timezone.utc).timestamp())
-- MySQL
SELECT UNIX_TIMESTAMP('2026-07-01 00:00:00');
A Unix timestamp is always UTC — it has no time zone of its own. The time zone only appears when you format it for humans:
America/New_York).Need to see what a timestamp means across cities? Use our time zone converter after converting.
On January 19, 2038 at 03:14:07 UTC the timestamp reaches 2147483647 — the maximum value of a signed 32-bit integer. Systems that still store Unix time in 32 bits will overflow to a negative number and read the date as December 1901.
Modern 64-bit systems are safe for ~292 billion years, but the problem persists in embedded devices, old file formats and legacy databases. If you maintain long-lived systems (contracts, mortgages, certificates expiring after 2038), verify your storage type today.
* 1000 in JavaScript's Date() constructor, which expects milliseconds.datetime.fromtimestamp() in Python without tz= — it silently applies the server's local zone.new Date(ts*1000) in JavaScript, datetime.fromtimestamp(ts, tz=timezone.utc) in Python, FROM_UNIXTIME(ts) in MySQL — or paste it in the tool above.Math.floor(Date.now()/1000) in JavaScript, int(time.time()) in Python, time() in PHP, date +%s in a Linux terminal, or just look at the top of this page — the live value updates every second.-31536000 corresponds to January 1, 1969.Math.floor(new Date('2026-07-01').getTime()/1000) (JavaScript), UNIX_TIMESTAMP('2026-07-01') (MySQL).