What is the Unix Timestamp Converter?
A Unix timestamp (also called epoch time or POSIX time) is the number of seconds since 00:00:00 UTC on 1 January 1970, not counting leap seconds. Databases, APIs, log files and JWTs store time this way because it is a single number that is the same in every time zone.
Paste a timestamp and this epoch converter detects whether it is in seconds (10 digits), milliseconds (13 digits, as used by JavaScript and Java), microseconds or nanoseconds. It shows the date in your local time zone, in UTC, as ISO 8601 and relative to now. To go the other way, pick a date and time to get its Unix timestamp. The live clock at the top shows the current epoch time.
How to use the Unix Timestamp Converter
- To read a timestamp, paste it into Timestamp → date. The unit is detected automatically.
- To create a timestamp, choose a date and time under Date → timestamp and say whether it is local time or UTC.
- Click Copy next to any value.
Get the current Unix timestamp in code
| Language | Code |
|---|---|
| JavaScript | Math.floor(Date.now() / 1000) |
| Python | int(time.time()) |
| Java | Instant.now().getEpochSecond() |
| Go | time.Now().Unix() |
| PHP | time() |
| Bash | date +%s |
| PostgreSQL | extract(epoch from now()) |
Frequently asked questions
Is a Unix timestamp in seconds or milliseconds?
The Unix standard uses seconds. JavaScript, Java and many APIs use milliseconds. A current timestamp has 10 digits in seconds and 13 in milliseconds, and this tool detects which one you entered.
Does a Unix timestamp depend on time zone?
No. A timestamp is always counted from midnight UTC on 1 January 1970, so it means the same moment everywhere. Time zones only matter when you display it as a date.
What is the year 2038 problem?
Systems that store timestamps as signed 32-bit integers overflow at 03:14:07 UTC on 19 January 2038 (timestamp 2147483647). Modern systems use 64-bit values, which last for billions of years.
Can timestamps be negative?
Yes. Negative values represent dates before 1970. For example, -86400 is 31 December 1969.