How to use the Unix Timestamp Converter
- The current Unix timestamp updates live at the top. Click Copy to grab it.
- Paste a timestamp under Timestamp → date. The unit is detected from its length, or choose it yourself.
- Pick a time zone to see the local date there, plus ISO 8601 and relative time.
- Under Date → timestamp, choose a date, time and time zone to get the Unix timestamp.
What is a Unix timestamp?
Unix time (also called epoch time or POSIX time) counts the seconds since 00:00:00 UTC on 1 January 1970, ignoring leap seconds. It's the same number everywhere in the world at a given moment, which is why databases, APIs and log files use it. Time zones only matter when you turn it into a calendar date.
Seconds, milliseconds or more?
- 10 digits (e.g. 1791720000): seconds, used by Unix, PHP, Python's
time.time()and most APIs. - 13 digits: milliseconds, used by JavaScript's
Date.now()and Java. - 16 digits: microseconds; 19 digits: nanoseconds, used by Go and some databases.
Get the current timestamp in code
| JavaScript | Math.floor(Date.now() / 1000) |
|---|---|
| Python | int(time.time()) |
| PHP | time() |
| Java | Instant.now().getEpochSecond() |
| Go | time.Now().Unix() |
| MySQL | SELECT UNIX_TIMESTAMP(); |
| PostgreSQL | SELECT extract(epoch FROM now()); |
| Bash | date +%s |
The year 2038 problem
Systems that store Unix time as a signed 32-bit number overflow at 03:14:07 UTC on 19 January 2038 (timestamp 2147483647) and wrap around to 1901. Modern systems use 64-bit time, which lasts for billions of years.
Frequently asked questions
Does a Unix timestamp depend on the time zone?
No. A timestamp is the same everywhere. Only the date and time it's displayed as changes with the time zone.
How are daylight saving changes handled?
Conversions use your browser's built-in time zone database. When a local time occurs twice (clocks go back), the earlier one is used. When it doesn't exist (clocks go forward), it's moved forward an hour.
Can I convert dates before 1970?
Yes. Earlier dates have negative timestamps, e.g. -86400 is 31 December 1969.
What about leap seconds?
Unix time ignores leap seconds: every day is exactly 86,400 seconds.