Unix Time Converter and World Clock
Convert Unix time in seconds, milliseconds or nanoseconds to a date and back, see UTC, local and relative time, and watch the clock in 15 major time zones.
The interactive tool loads here when JavaScript runs.
About this toolWhat is the Time Converter?
The left card converts between Unix timestamps and human-readable dates. Choose the unit (seconds, milliseconds or nanoseconds), then either type a timestamp and click From Unix, or pick a date and time and click To Unix. The result is shown in UTC, in your local zone and as a relative time such as "2 years 295 days ago".
The right card is a live clock. It shows the current time in UTC, in your own time zone and in one more zone you pick from 15 common ones, including New York, London, Berlin, Kolkata, Tokyo and Sydney. Every value has a copy button.
All conversions use your browser's Date and Intl APIs, so time zone and daylight saving rules come from the IANA database built into your browser. Nothing is sent to a server.
- Unix seconds, milliseconds and nanoseconds both ways
- Exact 19-digit nanosecond parsing with BigInt
- UTC, local and relative time for any converted date
- Live clock for UTC, your zone and 15 world time zones
- Copy buttons on every value
Updated
How to use the Time Converter
- Choose Seconds, Milliseconds or Nanoseconds in the Format menu.
- To read a timestamp, paste it into Unix Timestamp and click From Unix.
- To create one, pick a date and time in Human-Readable Time and click To Unix, or click Now for the current moment.
- Read UTC Time, Your Local Time and Relative Time under Converted Time Details.
- In the Timezone Converter card, pick a zone from Select Timezone to see its current time beside UTC and yours.
Worked examples
Seconds to a date
Input
1640995200 (Seconds), From Unix
Output
UTC Time: 2022-01-01 00:00:00.000 UTC
In New York the date picker shows 2021-12-31 19:00:00, because Eastern Standard Time is UTC-5. Clicking To Unix returns 1640995200.
Nanoseconds are parsed exactly
Input
1640995200123456789 (Nanoseconds)
Output
2022-01-01 00:00:00.123 UTC
The 19-digit value is read with BigInt, so the millisecond part is right. The final 456789 nanoseconds cannot be represented in a JavaScript Date.
Background and insight
Unix time counts seconds since 1970-01-01 00:00:00 UTC, ignoring leap seconds, so every day is exactly 86,400 seconds. The number is the same everywhere on Earth at a given instant; only its display changes with the time zone. That is why timestamps are the safest way to store and compare moments in logs, databases and APIs.
Units are the usual trap. Unix tools, JWT exp and iat claims and most HTTP APIs use seconds; JavaScript's Date.now() and Java's currentTimeMillis() use milliseconds; Go's time.UnixNano() and many tracing systems use nanoseconds. A current timestamp has 10 digits in seconds, 13 in milliseconds and 19 in nanoseconds. Nineteen digits is more than a JavaScript number can hold exactly, so this tool parses timestamps with BigInt before converting.
The date picker works in local time. When you convert from a timestamp, the picker is filled with your local wall-clock time to the second, so clicking To Unix straight afterwards gives back the same number. JavaScript dates only have millisecond precision, so nanoseconds below the millisecond are dropped when converting to a date.
Common use cases
Reading logs and database rows
Turn epoch values from logs, Redis TTLs or created_at columns into dates during an incident.
Checking token expiry
Convert a JWT exp claim in seconds to see exactly when a token stops being valid.
Writing test data
Generate a precise timestamp for a fixture, a mock API response or a cache expiry test.
Scheduling across offices
Glance at UTC, your time and a colleague's zone before booking a call or a deploy.
Tips and limitations
- If a converted date lands in January 1970, a seconds value was read as milliseconds. If it lands thousands of years ahead, milliseconds were read as seconds.
- Decimal timestamps such as 1640995200.5 are accepted and rounded down to the millisecond.
- Relative time counts 365-day years and ignores leap days, so it is an approximation for long spans.
- Signed 32-bit timestamps overflow at 2038-01-19 03:14:07 UTC (2147483647). JavaScript uses 64-bit floats and is not affected, but older C code and database columns can be.
- For several zones at once or a specific meeting time, use the Time Zone Converter; this clock shows the current moment only.
Sources and further reading
- POSIX Base Definitions: General Concepts (Seconds Since the Epoch), The Open Group. How Unix time is defined without leap seconds
- RFC 7519: JSON Web Token (JWT), IETF. exp and iat are NumericDate values in seconds
- Date.now(), MDN Web Docs. JavaScript timestamps are in milliseconds
- BigInt, MDN Web Docs. Exact integers beyond 2^53
- Package time, The Go Authors. Time.UnixNano and Time.UnixMilli
Frequently asked questions
How do I convert a Unix timestamp to a date?
Paste the number into Unix Timestamp, set Format to the right unit, and click From Unix. A 10-digit value is seconds and a 13-digit value is milliseconds for current dates. The UTC, local and relative times appear below the buttons.
How do I get the current Unix timestamp?
Click Now next to the timestamp field, or read Current Unix Timestamp at the bottom of the card, which updates every second. Change Format to switch between seconds, milliseconds and nanoseconds.
Why is my converted date in 1970?
The timestamp is probably in seconds but was read as milliseconds, so it lands a few weeks after 1 January 1970. Switch Format to Seconds and convert again. The opposite mistake puts the date tens of thousands of years in the future.
Does Unix time depend on the time zone?
No. A Unix timestamp identifies one instant worldwide; it is always counted from 1970-01-01 00:00 UTC. Only the human-readable display changes, which is why the tool shows UTC and your local time side by side.
Are nanosecond timestamps converted without rounding?
They are parsed exactly with BigInt, so all 19 digits are read correctly and converted to whole milliseconds. Anything below a millisecond is dropped, because a JavaScript Date only stores milliseconds. To Unix in nanoseconds always ends in six zeros for the same reason.
Which time zones does the world clock show?
UTC, the zone your browser reports, and one selectable zone from a list of 15: UTC, New York, Chicago, Denver, Los Angeles, Toronto, London, Paris, Berlin, Rome, Dubai, Kolkata, Shanghai, Tokyo and Sydney. Daylight saving is applied automatically.
Is there an in-depth guide to the Time Converter?
Yes. “Date Math for Developers: Month Ends, DST Days and Unix Time” covers the background, how it works, common pitfalls and worked examples. Read the full guide.
Related Tools You May Like
Free, in-browser tools that pair well with this one.