Unix timestamp converter
Turn epoch time into a real date, and back.
Timestamp to date
- Local time
- UTC
- ISO 8601
- Relative
Date to timestamp
- Seconds
- Milliseconds
- ISO 8601
Runs in your browser. Nothing you type is sent anywhere.
- Live current timestamp
- Seconds, ms or microseconds
- Local, UTC and ISO 8601
How to convert a Unix timestamp
- Paste a timestamp. The unit is detected from its length.
- Read the date in local time, UTC, ISO 8601 and relative time.
- To go the other way, pick a date and time and copy the timestamp.
How the unit is detected from digit count
| Integer digits | Read as |
|---|---|
| Up to 11 | Seconds |
| 12 to 14 | Milliseconds |
| 15 to 17 | Microseconds |
| 18 or more | Nanoseconds |
Pick a unit yourself from the dropdown if a number happens to sit right at one of these borders.
Getting the current timestamp in code
| Language or tool | Code |
|---|---|
| JavaScript | Math.floor(Date.now() / 1000) |
| Python | int(time.time()) |
| PHP | time() |
| Linux or macOS terminal | date +%s |
| PostgreSQL | EXTRACT(EPOCH FROM NOW()) |
A few notes on how Unix time behaves
- It counts SI seconds but ignores leap seconds by definition, so it stays a simple, steadily increasing count instead of tracking exact solar time.
- Systems that store it as a signed 64-bit integer push the year 2038 problem out to the year 292,277,026,596.
- JavaScript's own Date object is limited to about 273,790 years on either side of 1970, a separate limit from the 32-bit overflow issue.
Unix timestamp converter FAQ
What is a Unix timestamp?
The number of seconds since January 1, 1970 at 00:00:00 UTC, a moment called the Unix epoch. It ignores leap seconds and is the same number everywhere in the world, whatever the time zone.
How do I tell seconds from milliseconds?
Count the digits. Current times have 10 digits in seconds and 13 in milliseconds, so 1700000000 and 1700000000000 are the same moment. JavaScript's Date.now() returns milliseconds, while most Unix tools use seconds.
What is the year 2038 problem?
Systems that store the timestamp as a signed 32-bit number run out at 2147483647, which is 03:14:07 UTC on January 19, 2038. The next second wraps to a negative number that lands in December 1901. 64-bit timestamps do not have this limit.
How do I get the current timestamp in code?
In JavaScript use Math.floor(Date.now() / 1000), in Python int(time.time()), in PHP time(), and in a Linux or macOS terminal date +%s.
Can a Unix timestamp be negative?
Yes. Negative numbers count back from 1970, so -86400 is December 31, 1969 at 00:00 UTC. This converter accepts them.
Does a Unix timestamp account for time zones?
No. It counts seconds since a single moment in UTC, so the same number means the same instant everywhere in the world. Time zone only comes into it once you turn that number into a human-readable local date.