Unix timestamp converter
Convert Unix timestamps in seconds, milliseconds, microseconds or nanoseconds to UTC, local and ISO 8601 dates, and dates back to epoch time, with the unit detected and relative time shown. Runs in your browser.
What it does
- Converts epoch numbers to dates, guessing the unit from the number of digits: about 10 for seconds, 13 for milliseconds, 16 for microseconds and 19 for nanoseconds. Negative and fractional values work, and you can set the unit yourself.
- Reads date strings too: ISO 8601 / RFC 3339 (
2024-05-01T12:00:00Z, with or without an offset), RFC 2822 and HTTP dates (Wed, 21 Oct 2015 07:28:00 GMT),YYYY-MM-DD HH:MM:SS, certificate UTCTime and GeneralizedTime (240501120000Z), Windows FILETIME / LDAP values and Apple Cocoa timestamps. - Shows the result in UTC, your local time and any other time zone, as ISO 8601, an HTTP date, epoch seconds, milliseconds, microseconds and nanoseconds, and relative to now ("3 days ago"), with the weekday, ISO week and day of year.
- Paste several values, one per line, to get a table you can copy as CSV.
- Turns a date and time in a chosen time zone back into epoch seconds and milliseconds, handling daylight saving gaps and overlaps.
What a Unix timestamp is
Unix time counts seconds since 1970-01-01 00:00:00 UTC, ignoring leap seconds. It has no time zone: the same number is the same instant everywhere, and only its display changes. JavaScript, Java and many APIs use milliseconds instead, Go and databases often use nanoseconds, and Windows counts 100-nanosecond intervals since 1601, which is why the same moment can be a 10, 13, 16, 18 or 19 digit number.
Systems that store the seconds in a signed 32-bit integer overflow after 2038-01-19 03:14:07 UTC (2147483647), the year-2038 problem. The converter warns when a value is past that point.
Questions
- How do I tell seconds from milliseconds?
- Count the digits. A current date is 10 digits in seconds and 13 in milliseconds. If a date comes out in 1970 the value was probably milliseconds read as seconds; if it is tens of thousands of years away, it was the other way round.
- Why is my date off by a few hours?
- A date string without a zone, such as
2024-05-01 12:00:00, is ambiguous. This tool reads it as UTC unless you tick the local time option. JavaScript'snew Date()reads the same string as local time, which is a common source of bugs. - What is a FILETIME or LDAP timestamp?
- Windows and Active Directory attributes such as
lastLogonTimestampandpwdLastSetcount 100-nanosecond intervals since 1601-01-01 UTC. They are 18 digits long; the converter reads 18-digit numbers this way automatically. - Does it handle leap seconds?
- Unix time skips them, so
23:59:60is shown as the following second. Everything else follows the time zone rules built into your browser.