utilobox

Unix timestamp converter: seconds, milliseconds and time zones

A log line, a database column or an API reply shows a long number where a date should be. This guide shows how to use a Unix timestamp converter in your browser to read that epoch time as a date, how to tell seconds from milliseconds, and why the time zone changes what you see.

Last updated:

What the number counts

A Unix timestamp counts the time since 00:00:00 UTC on 1 January 1970, called the epoch. It has no time zone of its own. It names one instant that is the same for everyone on Earth, and the time zone only matters when you display that instant as a clock time. Leap seconds are not counted, so every day is exactly 86,400 seconds.

A familiar value is 1,700,000,000 seconds, which is 22:13:20 UTC on 14 November 2023. The same instant reads 17:13:20 in New York and 07:13:20 on 15 November in Tokyo, which shows why a bare timestamp is useful: all three readings are one number. Zero is the epoch itself, and negative numbers are moments before 1970. For example, minus 86,400 is 31 December 1969 at midnight UTC.

Using the Unix timestamp converter, step by step

Open the Unix Timestamp Converter. At the top the current time runs live in seconds and in milliseconds, each with a copy button, and ‘Pause’ freezes it so you can copy a steady value. Under ‘Timestamp to date’, paste the number into ‘Unix timestamp’. You can type commas, underscores or spaces between the digit groups; the tool ignores them, so 1,700,000,000 works as well as the plain digits.

The result block lists the moment in several forms: ‘UTC’, ‘Your local time’, the ‘Selected time zone’ if you chose one, ‘ISO 8601 (UTC)’, ‘RFC 2822’, ‘Relative to now’ and the ‘Unix seconds’ and ‘Unix milliseconds’. Each row has a copy button. A line above the results says how the number was read, for example ‘Read as seconds’. Use ‘Use current time’ to fill in the present moment and compare.

Only digits are accepted, with an optional minus sign and a decimal part. Anything else shows ‘Enter a Unix timestamp using digits only.’ A number so large that no date can show it gives the message ‘That timestamp is outside the range a date can show.’

Seconds, milliseconds, microseconds: how the unit is detected

Different systems store the same count in different units, and the unit changes the number of digits. The converter guesses from the size. Values below 100,000,000,000 are read as seconds, values below 100 trillion as milliseconds, values below 100 quadrillion as microseconds, and anything larger as nanoseconds. In practice a current timestamp has 10 digits in seconds, 13 in milliseconds, 16 in microseconds and 19 in nanoseconds.

If the unit is wrong the date is absurd, which is the quickest check. Read as seconds, 1,700,000,000,000 would land tens of thousands of years from now; read as milliseconds it is the correct November 2023. The ‘Unit’ menu lets you override the guess with ‘Seconds’, ‘Milliseconds’, ‘Microseconds’ or ‘Nanoseconds’. Use it for the one case where detection must fail: a millisecond value for a date before early March 1973 has too few digits and looks like seconds, so set ‘Milliseconds’ yourself.

Date to timestamp, and the time zone you pick

Go the other way under ‘Date to timestamp’. Enter the ‘Date’ and ‘Time’ and the page returns ‘Unix seconds’ and ‘Unix milliseconds’ with the ISO and RFC forms. The date means a wall-clock time, and a wall-clock time means nothing until you say where. The ‘Time zone’ menu has ‘Your time zone’, ‘UTC’ and a list of cities. A note says that dates without an offset are read in the selected zone.

The difference is large. Midnight at the start of 1 January 2027 in UTC is 1,798,761,600. Midnight in New York is five hours later, 1,798,779,600. Send the wrong one to a system and the date can be a day out for half the world. Daylight saving is applied for the zone you select, so the same clock time in July and January gives timestamps with different gaps to UTC. Always check the zone before you copy the result.

Many values at once: the batch converter

For a column of values from a log, paste them into the ‘Batch converter’, one per line. A line of digits is treated as a timestamp, with the unit detected automatically, and becomes an ISO 8601 date. A line that looks like a date and time becomes Unix seconds. Results appear as you type, and ‘Copy results’ copies them all. A line the tool cannot read shows ‘not recognised’ next to it, so one bad line does not stop the rest.

Accepted date forms include 2024-05-01, 2024/05/01 and 2024.05.01, with an optional time such as 13:00 or 13:00:30 and fractions of a second. A trailing Z or an offset like +02:00 is honored as written, and a date with no offset is read in the selected zone. Decimal seconds are allowed in the timestamp direction, but the result is rounded down to whole milliseconds.

The 2038 limit, in one example

Some older systems store the seconds in a signed 32-bit number. The largest value that fits is 2,147,483,647, which is 03:14:07 UTC on 19 January 2038. One second later such a field overflows and can wrap to a date in 1901. You can see the boundary yourself: paste 2,147,483,647 and then 2,147,483,648 into the converter. This Unix timestamp converter uses larger numbers and shows the second date without trouble.

An unsigned 32-bit field lasts longer, until 7 February 2106. If you meet a timestamp that suddenly becomes negative or jumps to 1901 or 1970, check the width and signedness of the field in the system that wrote it before you blame the date. The converter cannot repair data in another system, but it shows what the number should mean.

Habits that avoid mistakes

Store and exchange the timestamp or an ISO 8601 date with an offset, and convert to local clock time only to show a person. Write the unit next to the number in notes and tickets: ‘ms’ or ‘s’. When two systems disagree by a few hours, compare the zone first. When they disagree by a factor of a thousand, compare the unit.

The Unix timestamp converter runs in your browser, and the numbers you paste are not sent anywhere. Your chosen time zone is remembered on this device. Values so large or so small that a browser cannot show a date for them give the range message, and they are far outside what real data needs. Because the page only reads and writes timestamps, it cannot tell you which clock produced them; a device with a wrong clock produces wrong timestamps.

Questions and answers

How do I convert epoch time to a date?

Paste the number into ‘Unix timestamp’. The converter detects seconds, milliseconds, microseconds or nanoseconds and shows the date in UTC, your local time and ISO 8601.

How can I tell seconds from milliseconds?

A current timestamp has 10 digits in seconds and 13 in milliseconds. If the date looks far in the future, the unit is probably wrong, and you can choose it in the ‘Unit’ menu.

Does a Unix timestamp have a time zone?

No. It marks one instant. The time zone only changes how that instant is written as a clock time.

What is the year 2038 problem?

Signed 32-bit seconds run out at 03:14:07 UTC on 19 January 2038. The converter uses larger numbers, so it shows dates after that.

Can I convert a whole list?

Yes. Paste one timestamp or date per line into the ‘Batch converter’ and press ‘Convert’ or just keep typing.