Unix Timestamp Converter

Convert between a Unix timestamp — seconds or milliseconds since 1 January 1970 — and an ISO 8601 date, in both directions, without sending anything to a server.

—

What this tool does

It moves between the two ways of writing the same instant. A Unix timestamp is one integer counting from the epoch; an ISO 8601 string is a calendar date and time. The first panel turns a timestamp into UTC ISO 8601 text and reports how far that instant sits from now. The second panel turns an ISO 8601 date back into a timestamp in the selected unit.

Method

The Unix epoch is 1970-01-01T00:00:00Z, and a timestamp counts from there with no time zone attached. The unit is a factor of 1000: one second is one thousand milliseconds, so a value in milliseconds is divided by 1000 before use, and a value in seconds is multiplied by 1000. The result is rendered as ISO 8601 in UTC, where the trailing Z denotes UTC. When you enter a date, an explicit offset such as Z, +02:00 or -05:00 fixes the instant; a string without one is interpreted in your local time zone, so include the offset when the result must be unambiguous.

Example

TimestampISO 8601 (UTC)
0 s1970-01-01T00:00:00.000Z
1700000000 s2023-11-14T22:13:20.000Z

Seconds, milliseconds, and which one you have

A Unix timestamp counts seconds from 1970-01-01T00:00:00Z. The most common bug in reading one is scale: JavaScript's Date.now() returns milliseconds, while almost every API and database field returns seconds. Divide by 1,000 before converting a millisecond value, or you get a date roughly 50,000 years in the future.

ValueUnitDate
1700000000seconds2023-11-14T22:13:20Z
1700000000000milliseconds2023-11-14T22:13:20Z

A quick sanity check: a 10-digit number is almost certainly seconds, a 13-digit number almost certainly milliseconds. Anything with 16 or more digits is microseconds or nanoseconds, which some systems use for logging.

Timezone: the timestamp has none

A Unix timestamp is an instant, independent of timezone — it is the same number everywhere. A formatted timestamp does have a timezone, and that is where confusion enters: the same instant is 22:13 in UTC, 23:13 in Berlin and 06:13 the next day in Tokyo. This tool formats in UTC, which is the unambiguous choice; if you need local time, convert after you have the correct instant.

The other half of the problem is that a timestamp without a timezone is ambiguous when it comes from a human. “2023-11-14 22:13” could be any of several instants. That is why ISO 8601 requires the Z or an offset — 2023-11-14T22:13:20Z is unambiguous, 2023-11-14 22:13:20 is not.

Leap seconds and why timestamps ignore them

Unix time counts seconds as if every day had exactly 86,400 of them. Leap seconds, which are occasionally inserted to keep civil time aligned with the Earth's rotation, are absorbed rather than counted — so a timestamp can repeat a second, or skip one, and the arithmetic still works. This is a deliberate simplification: it keeps duration calculations exact at the cost of not being a literal count of SI seconds since 1970.

The 2038 problem

A signed 32-bit integer holding seconds overflows on 2038-01-19T03:14:07Z. Systems that store timestamps in 32 bits — older C code, some embedded systems, some file formats — will wrap to a negative value and produce dates in 1901. Modern systems use 64-bit integers and are not affected for billions of years; the risk is in legacy storage and in formats that inherited a 32-bit field.

What this tool converts

It reads a Unix timestamp in seconds and shows the ISO 8601 form in UTC, along with the reverse direction: paste an ISO 8601 date and get the integer. It does not apply a timezone or a locale, and it does not guess between seconds and milliseconds — check the digit count first if a value looks wrong by a factor of a thousand.

Frequently asked questions

What is the year 2038 problem?

A 32-bit signed integer counting seconds since 1970 runs out on 2038-01-19T03:14:07Z, because the next second overflows the sign bit. Systems that still store time in that type will wrap to 1901. Most modern platforms use 64-bit time and are unaffected, but embedded devices, old databases and file formats with 32-bit timestamps are not; the fix is to widen the field before the deadline, not to hope.

How do I convert a timestamp to milliseconds?

Multiply by 1,000 — or use the unit selector here. JavaScript’s Date and many APIs expect milliseconds, while Unix tools, most logs and database epoch columns use seconds. A 10-digit value is seconds, a 13-digit value is milliseconds; mixing them is the most common timestamp bug and puts the date decades away rather than hours.

Why is 1 January 1970 the epoch?

It is a convention chosen by early Unix, not a natural constant. Other systems use different epochs — Windows FILETIME counts from 1601, .NET from 0001, some embedded systems from 2000 — so an integer without a stated epoch is ambiguous. When a timestamp looks wildly wrong, check the epoch and the unit before assuming the data is corrupt.

What is a Unix timestamp?

A Unix timestamp is the number of seconds that have elapsed since 00:00:00 UTC on 1 January 1970, not counting leap seconds. It is a single integer with no time zone attached, which is why it is used to store and exchange time between systems.

Seconds or milliseconds — how do I tell which one I have?

A timestamp in seconds is currently ten digits long; the same instant in milliseconds is thirteen digits. This tool lets you pick the unit explicitly rather than guessing, so both forms convert correctly.

Why does the output end in Z?

The Z is ISO 8601 shorthand for UTC, otherwise written +00:00. The converted value is an absolute instant in UTC; render it in another time zone only for display.

Is the conversion affected by my local time zone?

No. The timestamp is an instant independent of time zone. Entering a date without an offset is interpreted by the browser in its local zone, so include an explicit offset such as Z or +02:00 when you need an unambiguous result.

Can timestamps be negative?

Yes. A negative value denotes an instant before 1 January 1970, and it converts to an ISO 8601 string with a year before 1970.

Is anything sent to a server?

No. Both directions are computed with the browser’s own date functions and nothing leaves the page.

Sources

  • ISO 8601, Date and time format.
  • RFC 3339, Date and Time on the Internet: Timestamps.

Everything runs in your browser — nothing you type is uploaded.