Unix Timestamp Converter
Runs locallyEpoch to date and back, in any time zone — seconds, ms, µs or ns detected.
Current Unix time
Timestamp → date
Paste seconds, milliseconds, microseconds or nanoseconds; the unit is detected from the number of digits.
Date → timestamp
Type an ISO 8601 or RFC 2822 date, or pick one. A time without Z or an offset is read in your local zone.
Offset given — the instant is exact.
In other time zones
Enter a timestamp above.
Batch convert
One timestamp or date per line — mixed units are fine.
| Input | Read as | Unix seconds | ISO 8601 (UTC) |
|---|---|---|---|
| 1700000000 | seconds | 1700000000 | 2023-11-14T22:13:20.000Z |
| 1700000000123 | milliseconds | 1700000000 | 2023-11-14T22:13:20.123Z |
| 1700000000123456789 | nanoseconds | 1700000000 | 2023-11-14T22:13:20.123Z |
| 2024-02-29T12:00:00Z | date | 1709208000 | 2024-02-29T12:00:00.000Z |
| Mon, 15 Jan 2024 09:30:00 +0000 | date | 1705311000 | 2024-01-15T09:30:00.000Z |
Current timestamp in code
Math.floor(Date.now() / 1000) // Date.now() is millisecondsimport time; int(time.time())time.Now().Unix() // .UnixMilli() for msInstant.now().getEpochSecond() // System.currentTimeMillis() for mstime()SELECT extract(epoch FROM now())::bigint;SELECT UNIX_TIMESTAMP();date +%s # date +%s%3N for ms (GNU date)A Unix timestamp is a count of seconds since 1970, in UTC
Unix time counts the seconds elapsed since 00:00:00 UTC on 1 January 1970, the Unix epoch. It has no time zone: 1700000000 is the same instant in Mumbai and in New York, and only its display differs. That is why databases, APIs and log pipelines store it — comparisons and arithmetic are plain integer maths, and converting to a local time happens at the edge, for a person.
The same instant is written with different precision. Seconds (10 digits today) are the classic form, used by time(), JWT exp and iat claims, and most Unix tools. JavaScript’s Date.now() and Java’s System.currentTimeMillis() return milliseconds (13 digits). Go, Python’s time.time_ns() and many tracing systems use microseconds or nanoseconds (16 or 19 digits). Reading a millisecond value as seconds puts the date tens of thousands of years in the future, so this converter detects the unit from the digit count and shows which it chose. For the timestamps inside a token, decode the JWT and its exp and iat claims are converted for you.
Two limits catch real systems. A signed 32-bit integer runs out at 2147483647 — 03:14:07 UTC on 19 January 2038 — and the next second wraps to December 1901 on systems that still store time_t in 32 bits. And Unix time ignores leap seconds: every day is exactly 86,400 seconds, so a leap second is either repeated or smeared across the day by the clock source. For scheduling rather than converting, the cron expression builder shows when a job will next run.
Timestamps
1700000000 1700000000123 1700000000123456789
Detected unit → ISO 8601 (UTC)
seconds → 2023-11-14T22:13:20.000Z milliseconds → 2023-11-14T22:13:20.123Z nanoseconds → 2023-11-14T22:13:20.123456789Z
The same instant at three precisions. The nanosecond digits past the millisecond are kept exactly (BigInt), not rounded.
Where people get caught
Milliseconds read as seconds
A 13-digit value treated as seconds lands around the year 55,000. If a date looks absurd, check the unit — Date.now() and most Java APIs are milliseconds.
A date without an offset
2024-01-15T09:30 has no zone, so it is read as local time; 2024-01-15 on its own is midnight UTC in JavaScript. Add Z or +05:30 to make the instant unambiguous.
Storing local time instead of UTC
Converting to local time before storing means daylight-saving changes create duplicate or missing hours. Store the timestamp and convert when displaying.
The year 2038 in 32-bit fields
INT columns in MySQL, 32-bit time_t in embedded C and some file formats overflow on 19 January 2038. Use 64-bit integers or native timestamp types.
About Unix timestamps
How it works in 4 steps · 4 common use cases · 5 questions answered
About Unix timestamps
How it works in 4 steps · 4 common use cases · 5 questions answered
How it works
- 1.Paste a timestamp; the unit is detected from its digits, or pick one.
- 2.Read it as ISO 8601, RFC 2822 and relative time, and in every zone you added.
- 3.Type or pick a date to get its Unix seconds and milliseconds.
- 4.Paste a column into Batch convert and copy the results as CSV.
Common use cases
- •Reading created_at or exp values from logs and tokens
- •Checking when a cache entry or a signed URL expires
- •Converting a column of epoch values from a database export
- •Finding the local time of an incident across teams in several zones
FAQ
What is a Unix timestamp?
The number of seconds since 1970-01-01 00:00:00 UTC, not counting leap seconds. It identifies an instant independent of time zone; 0 is the epoch itself and negative values are earlier dates.
Is my timestamp in seconds or milliseconds?
Count the digits. For current dates, 10 digits is seconds, 13 is milliseconds, 16 microseconds and 19 nanoseconds. This page detects that automatically and shows the unit it used.
What is the year 2038 problem?
Systems that store Unix time in a signed 32-bit integer can count only to 2147483647, which is 03:14:07 UTC on 19 January 2038. One second later the value wraps to 1901. 64-bit timestamps do not have this limit.
Does Unix time include leap seconds?
No. Every Unix day has exactly 86,400 seconds, so the 27 leap seconds added since 1972 are not counted. During a leap second, clocks either repeat a second or spread it across the day.
How do I get the current timestamp in my language?
The code panel lists one-liners for JavaScript, Python, Go, Java, PHP, PostgreSQL, MySQL and Bash, each in seconds, with the millisecond variant where it differs.