How to convert a Unix timestamp
- Paste a timestamp into "Unix timestamp". The unit (seconds, milliseconds, or microseconds) is detected for you.
- Read the date in your time zone, in UTC, as ISO 8601, as RFC 2822, and as a relative time such as "3 days ago".
- To go the other way, type a date and time under "Date to timestamp", for example
2026-03-14 11:30:00, and copy the seconds or milliseconds.
The time zone menu applies to both sides. A date typed without an offset is read as the clock time in that zone, and daylight saving time is handled for you. Add Z or an offset such as +02:00 to the date to set it exactly.
Get the current timestamp in code
| Language | Now | Timestamp to date |
|---|---|---|
| JavaScript | Math.floor(Date.now() / 1000) | new Date(1700000000 * 1000) |
| Python | int(time.time()) | datetime.fromtimestamp(1700000000, tz=timezone.utc) |
| PHP | time() | date('c', 1700000000) |
| Java | Instant.now().getEpochSecond() | Instant.ofEpochSecond(1700000000L) |
| Go | time.Now().Unix() | time.Unix(1700000000, 0) |
| SQL (PostgreSQL) | EXTRACT(EPOCH FROM now()) | to_timestamp(1700000000) |
| Bash | date +%s | date -d @1700000000 |
Questions
What is a Unix timestamp?
It is the number of seconds that have passed since 1 January 1970 at 00:00:00 UTC, known as the Unix epoch. Because it is one plain number with no time zone, computers use it to store and compare moments in time.
How do I tell seconds from milliseconds?
Count the digits. Today, a timestamp in seconds has 10 digits, in milliseconds 13, and in microseconds 16. With "Auto" selected, the tool picks the unit from the size of the number. You can choose a unit yourself if you know it.
Does the tool send my timestamps anywhere?
No. Everything is calculated in your browser with the standard Date and Intl features, so nothing is uploaded or logged.
Why does the same timestamp show different times?
A timestamp is one moment, but clocks in different places show different local times for it. Pick a time zone to see the clock time there. UTC is the same everywhere.
Can a timestamp be negative?
Yes. Negative numbers are moments before 1 January 1970. For example, -86400 is 31 December 1969. The tool accepts them in any unit.
Credits
Built by OneTooling using standard browser features. No third-party code runs on your data.