How to convert a timestamp
- The current Unix time is shown at the top and ticks every second. Press Pause to freeze it for copying.
- Paste a timestamp into the input. The tool reports which unit it assumed and shows the moment in UTC, in your local time zone, in RFC 2822 format and relative to now.
- You can also paste an ISO 8601 date, such as 2023-11-14T22:13:20Z, to get the matching timestamp.
- To go the other way, pick a date and time under Date to timestamp and choose whether it is your local time or UTC.
What a Unix timestamp is
Unix time counts the seconds that have passed since 00:00:00 UTC on 1 January 1970, the "epoch". It is the same everywhere on Earth at a given moment — time zones only matter when it is turned into a calendar date and clock time — which is why servers, databases and logs store time this way.
Detecting the unit
Different systems count in different units. Unix and most databases use seconds; JavaScript and Java use milliseconds; some logging systems and Go use microseconds or nanoseconds. For current dates they have 10, 13, 16 and 19 digits. The tool uses that: up to 11 digits is read as seconds, 12–14 as milliseconds, 15–17 as microseconds and 18–19 as nanoseconds. The status line always says which reading it chose. Nanosecond values are larger than JavaScript can store exactly, so they are read with arbitrary-precision integers and then shown to the millisecond.
Leap seconds
Unix time ignores leap seconds: every day is exactly 86,400 seconds, and when a leap second is inserted the count effectively repeats a second. Converting a timestamp to a date is therefore simple arithmetic, and it matches what operating systems do. Time elapsed between two timestamps can be off by the number of leap seconds in between — 27 have been added since 1972.
Formats
ISO 8601 (for example 2023-11-14T22:13:20.000Z) sorts correctly as text and is the safest format for data exchange; the Z means UTC. RFC 2822 (Tue, 14 Nov 2023 22:13:20 +0000) is the format used in email headers and many server logs.
Examples
| Input | Read as | UTC |
|---|---|---|
1700000000 | seconds | 2023-11-14T22:13:20.000Z |
1700000000000 | milliseconds | 2023-11-14T22:13:20.000Z |
1700000000123456789 | nanoseconds | 2023-11-14T22:13:20.123Z |
1700000000.5 | seconds with a fraction | 2023-11-14T22:13:20.500Z |
-86400 | seconds, before the epoch | 1969-12-31T00:00:00.000Z |
2147483647 | seconds | 2038-01-19T03:14:07.000Z |
The last row is the largest value a signed 32-bit integer can hold. Systems that still store Unix time in 32 bits will overflow one second later, on 19 January 2038 — the "year 2038 problem".
Going the other way, 2023-11-14T22:13:20Z is 1700000000 seconds, or 1700000000000 milliseconds. In RFC 2822 form it is Tue, 14 Nov 2023 22:13:20 +0000.
Limits
- Ambiguous lengths. A 10-digit number is always read as seconds. A millisecond timestamp from early 1970 (fewer than 12 digits) would be misread; such values are rare outside tests.
- Millisecond precision. Microseconds and nanoseconds are truncated to milliseconds, the precision of JavaScript dates.
- Leap seconds are not counted, matching POSIX and every mainstream operating system.
- Local time uses your device's time zone setting. To see the same moment in other cities, use the time zone converter.
Frequently asked questions
How do I tell seconds from milliseconds?
Count the digits: current timestamps have 10 digits in seconds and 13 in milliseconds. The tool detects this automatically and says which it used.
Is a Unix timestamp in UTC?
Yes. It counts seconds since midnight UTC on 1 January 1970 and does not depend on time zones; only converting it to a clock time does.
What is the year 2038 problem?
Signed 32-bit integers can count up to 2,147,483,647 seconds, which is 03:14:07 UTC on 19 January 2038. Systems that store time that way will overflow after that moment.
Can I convert a negative timestamp?
Yes. Negative values are moments before 1 January 1970; -86400 is 31 December 1969.
Does it account for leap seconds?
No, and neither does Unix time. Each day counts as exactly 86,400 seconds.