toolery

Unix timestamp converter

Convert a Unix timestamp to a human-readable date and time, or convert a date back to its timestamp, in both seconds and milliseconds.

UTC
—
Your local time
—
ISO 8601
—
Relative
—
Seconds
—
Milliseconds
—

How it works

A Unix timestamp is a single count of seconds since midnight UTC on 1 January 1970 — the “epoch”. That date is not significant in itself; it was simply a round, recent starting point when Unix was being built in the early 1970s, and it stuck. Storing time as one number sidesteps timezones, leap years, and calendar rules entirely: the number is the same everywhere on earth, and only becomes a date when something decides which timezone to show it in. Two mistakes account for almost every bug here. The first is seconds versus milliseconds — JavaScript counts in milliseconds while most other systems count in seconds, so a value off by a factor of 1000 lands either in January 1970 or tens of thousands of years out; this page warns when the magnitude disagrees with the unit you picked. The second is forgetting that a date with no timezone is ambiguous, which is why UTC and your local time are both shown above, each labelled.

Used this in a paper or lesson?