How the Unix Timestamp Converter works
A Unix timestamp counts the time since 1 January 1970 00:00:00 UTC (the Unix epoch), ignoring leap seconds. Negative values are dates before 1970. Systems store it in different units: most Unix tools and JWTs use seconds, JavaScript and Java use milliseconds, and some databases and tracing tools use microseconds or nanoseconds.
When the unit is set to Detect automatically, the converter looks at the number of digits in the whole part: up to 11 digits is read as seconds, up to 14 as milliseconds, up to 17 as microseconds and anything longer as nanoseconds. For current dates that means 10, 13, 16 and 19 digits. Choose the unit yourself for very old or far-future dates, where the guess can be wrong.
The number is read with string arithmetic rather than floating point, so a 19-digit nanosecond timestamp keeps every digit and the ISO 8601 output shows all nine fractional digits. Dates can be from year −271821 to 275760, the range of a JavaScript date; anything outside it gets an error. Local time uses the time zone of your device. Date to timestamp reads the date and time either as your local time or as UTC and returns seconds and milliseconds.
How to use the Unix Timestamp Converter
- The current Unix timestamp is shown at the top in seconds and milliseconds and updates every second. Select Now to put the current time into both converters.
- Under Timestamp to date, type or paste a timestamp. Leave Unit on Detect automatically, or choose seconds, milliseconds, microseconds or nanoseconds yourself.
- Read the results as you type: UTC, your local time, ISO 8601, RFC 2822, how long ago it was, and the same moment in seconds and milliseconds.
- Under Date to timestamp, pick a date and time and choose whether it is your local time or UTC to get the timestamp in seconds and milliseconds.
- Select Copy next to any value to copy it to the clipboard.
Example
The timestamp 1700000000 (detected as seconds) converts to:
UTC Tue, 2023-11-14 22:13:20.000 UTC
ISO 8601 (UTC) 2023-11-14T22:13:20.000Z
RFC 2822 Tue, 14 Nov 2023 22:13:20 +0000
Unix seconds 1700000000
Unix milliseconds 1700000000000
The nanosecond timestamp 1700000000123456789 gives 2023-11-14T22:13:20.123456789Z, and -86400 gives 1969-12-31T00:00:00.000Z. Converting the date 2024-01-01 00:00:00 as UTC gives 1704067200 seconds and 1704067200000 milliseconds.
Common use cases
- Reading created_at, exp or iat values in API responses, database rows and JWT payloads.
- Checking when a log line was written when the log only records epoch milliseconds.
- Creating a timestamp for a test fixture, cron job or cache expiry at a specific date and time.
- Converting nanosecond timestamps from tracing tools or Go and Rust programs without losing digits.
- Working out whether a stored timestamp is in seconds or milliseconds.
Frequently asked questions
What is a Unix timestamp?
It is the number of seconds since 1 January 1970 00:00:00 UTC, known as the Unix epoch. It ignores leap seconds and is the same everywhere in the world, which makes it a convenient way to store a moment in time. Many systems count milliseconds instead of seconds.
How does the converter know if my timestamp is in seconds or milliseconds?
It counts the digits of the whole number: up to 11 digits is read as seconds, up to 14 as milliseconds, up to 17 as microseconds and longer values as nanoseconds. Current dates have 10, 13, 16 and 19 digits. For dates far in the past or future the guess can be wrong, so you can choose the unit yourself.
Can I convert negative timestamps?
Yes. Negative timestamps are dates before 1970; for example -86400 is 31 December 1969 00:00:00 UTC.
What is the largest timestamp that can be converted?
Dates are handled like JavaScript dates, which cover 8,640,000,000,000,000 milliseconds on either side of 1970: from year -271821 to 275760. A timestamp outside this range gets an error message instead of a wrong date.
Are nanosecond timestamps rounded?
No. The timestamp is read digit by digit instead of as a floating point number, so the ISO 8601 output shows all nine fractional digits and the seconds and milliseconds values are exact.
Which time zone is used for local time?
Local time uses the time zone set on your device, including daylight saving time for that date. To see the moment in other time zones, use the Date/Time Converter.