About this tool
A Unix timestamp (also called epoch time or POSIX time) is the number of seconds since 1 January 1970, 00:00:00 UTC. It’s how servers, databases, logs, JWTs and APIs store moments in time: one number, with no time zone or date format to get wrong. This epoch converter turns those numbers into readable dates and back, and shows the current Unix time ticking live at the top.
How to use it
- Timestamp → date: paste a number. In Auto mode the unit (seconds, milliseconds, microseconds or nanoseconds) is detected from the number of digits, or you can pick it. You get the date in UTC, in your local time zone, as ISO 8601 and as a relative time like “3 hours ago”.
- Date → timestamp: pick a date and time, and say whether it’s in your local time or UTC. You get the timestamp in seconds and milliseconds.
- Click any value to copy it.
Seconds, milliseconds, microseconds or nanoseconds?
Different systems count in different units. For dates around today, the number of digits tells you which one you have:
| Unit | Digits today | Example | Used by |
|---|---|---|---|
| Seconds | 10 | 1700000000 | Unix, PHP time(), Python time.time(), Go Unix(), JWT claims |
| Milliseconds | 13 | 1700000000000 | JavaScript Date.now(), Java currentTimeMillis(), Kafka, many JSON APIs |
| Microseconds | 16 | 1700000000000000 | PostgreSQL internals, some tracing and analytics tools |
| Nanoseconds | 19 | 1700000000000000000 | Go UnixNano(), OpenTelemetry, InfluxDB, Prometheus internals |
Mixing them up is the most common timestamp bug: a seconds value read as milliseconds lands in January 1970, and a milliseconds value read as seconds lands tens of thousands of years in the future.
Notable Unix timestamps
| Timestamp | Date (UTC) | |
|---|---|---|
0 | 1970-01-01 00:00:00 | The Unix epoch |
1000000000 | 2001-09-09 01:46:40 | First 10-digit timestamp |
1700000000 | 2023-11-14 22:13:20 | |
2000000000 | 2033-05-18 03:33:20 | |
2147483647 | 2038-01-19 03:14:07 | Largest signed 32-bit value: the “year 2038 problem” |
Get the current timestamp and convert it in code
Math.floor(Date.now() / 1000); // current Unix time, seconds
Date.now(); // ... in milliseconds
new Date(1700000000 * 1000).toISOString(); // "2023-11-14T22:13:20.000Z"
Date.parse('2024-01-01T00:00:00Z') / 1000; // 1704067200import time
from datetime import datetime, timezone
int(time.time()) # current Unix time, seconds
datetime.fromtimestamp(1700000000, tz=timezone.utc) # 2023-11-14 22:13:20+00:00
int(datetime(2024, 1, 1, tzinfo=timezone.utc).timestamp()) # 1704067200<?php
time(); // current Unix time, seconds
gmdate('c', 1700000000); // "2023-11-14T22:13:20+00:00"
strtotime('2024-01-01 00:00:00 UTC'); // 1704067200import java.time.Instant;
long now = Instant.now().getEpochSecond(); // seconds
long nowMs = System.currentTimeMillis(); // milliseconds
Instant.ofEpochSecond(1700000000); // 2023-11-14T22:13:20Zimport "time"
time.Now().Unix() // seconds
time.Now().UnixMilli() // milliseconds
time.Unix(1700000000, 0).UTC() // 2023-11-14 22:13:20 +0000 UTC-- PostgreSQL
SELECT extract(epoch FROM now()); -- current Unix time (with fraction)
SELECT to_timestamp(1700000000); -- 2023-11-14 22:13:20+00
-- MySQL
SELECT UNIX_TIMESTAMP();
SELECT FROM_UNIXTIME(1700000000); -- shown in the session time zonedate +%s # current Unix time
date -u -d @1700000000 # to a date (Linux, GNU date)
date -u -r 1700000000 # to a date (macOS)[DateTimeOffset]::UtcNow.ToUnixTimeSeconds()
[DateTimeOffset]::FromUnixTimeSeconds(1700000000).UtcDateTimeTime zone pitfalls
- A timestamp has no time zone.
1700000000is the same instant everywhere; only its display changes. Store timestamps or UTC, and convert to local time only when showing it to a person. - JavaScript date strings:
new Date("2024-01-01")is read as UTC midnight, butnew Date("2024-01-01T00:00")is read as local midnight. Add aZor an offset (+05:30) to be explicit. - Python: always pass
tz=timezone.utc.datetime.utcfromtimestamp()returns a “naive” datetime without a time zone and is deprecated since Python 3.12. - MySQL:
FROM_UNIXTIME()andTIMESTAMPcolumns use the session’s time zone, so the same number can display differently on two connections.
The year 2038 problem
Systems that store Unix time as a signed 32-bit integer can only count up to 2,147,483,647, which is 19 January 2038 at 03:14:07 UTC. One second later the value wraps around to a negative number, which reads as December 1901. Modern 64-bit systems and languages are not affected, but old embedded devices, file formats and database columns declared as 32-bit integers still are. Use 64-bit integers (BIGINT) or proper date types for anything that might reach 2038.
FAQ
What is the current Unix timestamp?
It is shown live at the top of this page, in seconds and milliseconds. It increases by one every second.
How do I convert a Unix timestamp to a date?
Paste it into the Timestamp → date box. The unit is detected automatically, and you get the date in UTC and in your local time zone. In code, multiply seconds by 1000 for JavaScript: new Date(ts * 1000).
Is my timestamp in seconds or milliseconds?
Count the digits. For current dates, 10 digits means seconds and 13 digits means milliseconds. 16 is microseconds and 19 is nanoseconds.
Why does my date show 1970?
A timestamp in seconds was treated as milliseconds, so it was 1000 times too small. Multiply it by 1000, or choose Seconds instead of Millis.
What is the year 2038 problem?
Systems that store Unix time as a signed 32-bit integer overflow on 2038-01-19 03:14:07 UTC. Use 64-bit integers or ISO 8601 strings for dates beyond that.
Do Unix timestamps include time zones?
No. A timestamp is always UTC-based. Time zones only matter when you display it as a date.
Do timestamps account for leap seconds?
No. Unix time ignores leap seconds; every day is exactly 86,400 seconds.