Unix timestamp converter: epoch to date and date to epoch
A Unix timestamp (also called epoch time) is the number of seconds that have elapsed since 00:00:00 UTC on 1 January 1970, not counting leap seconds. Many systems use milliseconds instead, which gives a 13-digit number instead of 10 digits. To convert a timestamp to a date, multiply seconds by 1,000 and construct a Date; to go the other way, divide. This converter shows the current epoch live, converts in both directions, and displays the result in UTC, your local time zone and ISO 8601.
Your files never leave your device. Processing happens in your browser.How that works.
How it works
- Paste a timestamp in seconds or milliseconds, or pick a date and time.
- Read the conversion in UTC, local time, ISO 8601 and relative time.
- Copy any format, or share the URL.
Runs as JavaScript inside this tab. Turn off your connection after the page loads and it still works.
Unix time reference
Definition
Unix time counts seconds since the Unix epoch, 1970-01-01 00:00:00 UTC, ignoring leap seconds. It is always UTC; time zones are applied only when displaying.
Recognising the unit
| Digits | Unit | Example (same instant) |
|---|---|---|
| 10 | seconds | 1789041600 |
| 13 | milliseconds | 1789041600000 |
| 16 | microseconds | 1789041600000000 |
| 19 | nanoseconds | 1789041600000000000 |
JavaScript, Java and most databases use milliseconds internally; POSIX APIs, PHP and Python’s time.time() use seconds; Go and Rust expose nanoseconds.
Landmarks
| Timestamp | Date (UTC) | Note |
|---|---|---|
| 0 | 1970-01-01 00:00:00 | Epoch |
| 1000000000 | 2001-09-09 01:46:40 | One billion seconds |
| 1234567890 | 2009-02-13 23:31:30 | |
| 1500000000 | 2017-07-14 02:40:00 | |
| 1700000000 | 2023-11-14 22:13:20 | |
| 2000000000 | 2033-05-18 03:33:20 | Two billion |
| 2147483647 | 2038-01-19 03:14:07 | 32-bit signed overflow (Y2038) |
| 4294967295 | 2106-02-07 06:28:15 | 32-bit unsigned overflow |
| −2208988800 | 1900-01-01 00:00:00 | NTP epoch |
Useful constants
| Period | Seconds |
|---|---|
| Minute | 60 |
| Hour | 3,600 |
| Day | 86,400 |
| Week | 604,800 |
| 30-day month | 2,592,000 |
| 365-day year | 31,536,000 |
| Average Gregorian year | 31,556,952 |
Getting the current timestamp
| Language | Now (seconds) | Timestamp → date |
|---|---|---|
| JavaScript | Math.floor(Date.now() / 1000) |
new Date(ts * 1000) |
| Python | int(time.time()) |
datetime.fromtimestamp(ts, tz=timezone.utc) |
| PHP | time() |
date('c', $ts) |
| Go | time.Now().Unix() |
time.Unix(ts, 0) |
| Java | Instant.now().getEpochSecond() |
Instant.ofEpochSecond(ts) |
| C# | DateTimeOffset.UtcNow.ToUnixTimeSeconds() |
DateTimeOffset.FromUnixTimeSeconds(ts) |
| Ruby | Time.now.to_i |
Time.at(ts) |
| Rust | SystemTime::now().duration_since(UNIX_EPOCH)?.as_secs() |
UNIX_EPOCH + Duration::from_secs(ts) |
| Bash | date +%s |
date -u -d @1700000000 |
| PostgreSQL | extract(epoch from now()) |
to_timestamp(1700000000) |
| MySQL | UNIX_TIMESTAMP() |
FROM_UNIXTIME(1700000000) |
| SQLite | strftime('%s','now') |
datetime(1700000000, 'unixepoch') |
| Excel | =(NOW()-DATE(1970,1,1))*86400 |
=A1/86400+DATE(1970,1,1) |
Other epochs you may meet
| System | Epoch | Unit |
|---|---|---|
| Windows FILETIME | 1601-01-01 | 100-nanosecond ticks |
| .NET DateTime | 0001-01-01 | 100-ns ticks |
| Excel serial date | 1899-12-30 | days |
| Apple Cocoa | 2001-01-01 | seconds |
| GPS | 1980-01-06 | seconds (includes leap seconds) |
| NTP | 1900-01-01 | seconds |
Worked examples
1700000000 → 2023-11-14T22:13:20.000Z
Ten digits, so seconds. In New York (UTC−5 in November) that is 5:13:20 PM.
1700000000000 → the same instant
Thirteen digits, detected as milliseconds. Force a unit from the dropdown if a system stores seconds with fractional digits.
2026-09-10T12:00:00Z → 1789041600
An ISO 8601 string with a trailing Z is UTC. Without the Z, the browser treats a date-only string (2026-09-10) as UTC but a date-time string (2026-09-10T12:00) as local time, a common source of one-day-off bugs.
“+2 days” → two days from now, in every format. Also accepts -3h, +90m, +1w.
2147483647 → 2038-01-19T03:14:07Z
The largest value a signed 32-bit integer can hold. One second later, systems that still use 32-bit time wrap to −2147483648, which is 1901.
Relative time uses the largest sensible unit: 90 seconds ago shows as “2 minutes ago”; 45 days ahead shows as “in 1 month”.
Frequently asked questions
Is my timestamp in seconds or milliseconds?
Timestamps around 1.7 billion (10 digits) are seconds; around 1.7 trillion (13 digits) are milliseconds. The converter detects this automatically and lets you override it.
What is the year 2038 problem?
Systems that store Unix time as a signed 32-bit integer overflow at 03:14:07 UTC on 19 January 2038. 64-bit systems are unaffected.
Does Unix time include leap seconds?
No. Unix time pretends every day has exactly 86,400 seconds, so it is not a true count of elapsed seconds; it drifts by one second at each leap second.
Why does my local time differ from UTC?
Unix time is always UTC. The local column applies your browser’s time zone offset, including daylight saving.
How do I get the current timestamp in code?
JavaScript: Math.floor(Date.now() / 1000). Python: int(time.time()). Bash: date +%s. SQL (Postgres): extract(epoch from now()).
Unix timestamp · last updated · changelog · part of Canned Tuna