⭐ 0

Unix Timestamp Converter

Convert a local date and time in a chosen IANA zone to Unix seconds, or read a seconds or milliseconds value back.

Processed entirely in your browser — nothing you enter here is ever uploaded.

Processing... 0%

Result

About this tool

The page has a datetime-local field, a zone menu, and a number field. On load it fills the zone menu from the runtime's IANA list, grouped by country where the zone table has a country code, and it selects your browser's zone. The datetime field is then filled with the current time written in that zone. Editing the datetime or the zone runs the date-to-timestamp path. Editing the number runs the other path. A preset can put a number in the field and take the timestamp path immediately, which is how an epoch page shows 1970 instead of now.

From the date side, the text must look like year-month-day, a T, hours, minutes, and optional seconds. Those clock fields are read as civil time in the selected zone, not as UTC and not as the browser zone unless that is the zone you picked. The resolver guesses a UTC instant and corrects it a few times until the zone's wall clock matches the fields you typed. If no instant produces that wall clock, which is what a spring-forward gap looks like, the result says the time is invalid. The number field is then set to the floored Unix seconds, the result line is the instant's ISO string, and the detail line shows seconds and the raw millisecond value from getTime().

From the number side, a non-finite value is rejected. The absolute value decides the unit. If it is strictly below 100,000,000,000, the number is seconds and is multiplied by 1000. Otherwise it is already milliseconds. 0 is the epoch: 1970-01-01T00:00:00.000Z. 1700000000 is below the cutoff, so it is seconds, and the ISO result is 2023-11-14T22:13:20.000Z. The same instant as milliseconds is 1700000000000, which is above the cutoff and is not multiplied again. The result line in this direction is the civil time in the selected zone, with the page language's full date and long time, and the detail line is the ISO string.

The cutoff is a fixed magnitude, not a year you configure. A seconds value past 100 billion would be about year 5138, so ordinary second counts stay in the seconds branch. Negative timestamps are allowed: the absolute value is what picks the unit, and a small negative number is still seconds before the epoch. The page does not accept a named timezone abbreviation such as EST as something you type. You pick an IANA name from the menu. It does not convert Excel serial dates, and it does not show leap seconds. Unix time here is the JavaScript instant, which ignores leap seconds.

Example. The number 0 is 1970-01-01T00:00:00.000Z. The number 1700000000 is read as seconds and is 2023-11-14T22:13:20.000Z. The number 1700000000000 is read as milliseconds and is the same instant.

Limit. A finite number whose absolute value is below 100,000,000,000 is seconds. Any larger absolute value is milliseconds. A wall time that falls in a daylight-saving gap is rejected.

Frequently asked questions

Is 1700000000 seconds or milliseconds?

Seconds. The rule is absolute value below 100,000,000,000. 1700000000 becomes the instant 2023-11-14T22:13:20.000Z. The millisecond form of that same instant is 1700000000000, and that longer number is not multiplied by 1000 again.

What does the zone menu change?

The datetime field is civil time in the zone you selected, not automatically UTC. The number underneath is still the UTC-based Unix instant. Changing the zone rewrites how that instant is displayed and how a typed wall clock is converted. Abbreviation strings such as EST are not something you can type. The menu is IANA names.

Why is a time in March rejected?

If the clock fields land in a gap where that zone skips an hour, no instant has that wall clock, and the page reports an invalid time. A repeated hour in the fall is resolved by the same correction loop. Leap seconds are not represented. The instant is the JavaScript one.

What is timestamp 0?

It is 1970-01-01T00:00:00.000Z. The date-to-number path writes floored seconds into the number field and shows both the second count and the millisecond count from getTime().