Skip to content
WGX

Unix Timestamp Converter

Turn a Unix timestamp into a date, and a date into a timestamp.

Seconds since 1 January 1970, UTC. It ticks while the page is open.

The other way round

This time is

That momentExample

a moment ago

paste a timestamp, or press "Use it" for right now

Paste a timestamp above, or press "Use it" for right now.

Seconds, milliseconds, microseconds, nanoseconds

The single most common mistake with timestamps is reading one in the wrong unit, and it is not a careless mistake: the result is always a plausible-looking date. A millisecond timestamp read as seconds lands somewhere in the year 55000; a second timestamp read as milliseconds lands around the third week of January 1970. Neither looks like an error until somebody notices.

The digit count gives it away, which is why this page counts for you:

  • 10 digits — seconds. Covers 2001 to 2286.
  • 13 digits — milliseconds. What JavaScript and Java hand you.
  • 16 digits — microseconds. Go's UnixMicro, many logging and tracing systems.
  • 19 digits — nanoseconds. Go's UnixNano, OpenTelemetry traces.

Below ten digits it really is ambiguous — 1000000 is 12 January 1970 in seconds and 1 January 1970 in milliseconds — so the unit can be set by hand whenever the guess is wrong.

UTC and your own time

A timestamp has no time zone: it is a count from one fixed moment, which is exactly what makes it useful for logs. The zone appears only when it is turned into a date, so both are shown here, and the local one is named rather than left as "local" — a converter that shows one unlabeled time is how an incident timeline ends up an hour out.

The epoch, and the year 2038

Counting starts at midnight UTC on 1 January 1970. Systems that keep the count in a signed 32-bit integer run out of room on 19 January 2038 at 03:14:07 UTC and wrap round to 1901 — the reason a great deal of quiet migration work has happened over the last decade. Anything using 64 bits is safe for longer than the sun has left, and nothing here is limited to 32.

Writing this moment into Discord

Discord parses <t:SECONDS:STYLE> inside a message and replaces it with a formatted date, shown to whoever reads it in their own time zone and locale — not the zone the message was sent from. SECONDS is a Unix timestamp counted in seconds, never milliseconds, which is the easy way to get this wrong: paste the millisecond count in by mistake and the message still renders, just centuries away from the moment meant. This page builds all seven of Discord's styles from the moment above, each copyable on its own, and says what each one means rather than what it will literally print — that part is Discord's to decide, not this page's.

Working out a span instead

This page answers "what time is this number". If the question is "how long between these two dates", that is the Time Duration Calculator.

Nothing is sent

The conversion is arithmetic and it happens in your browser. The test suite for this page watches what the converter asks the network for and fails if any of it could carry the value — which matters because a timestamp is usually copied out of a production log, and what is next to it on the line is rarely public.

Questions

How do I convert a Unix timestamp to a date?

Paste the number in. The unit is worked out from how many digits it has, named on screen so you can check it, and the moment is shown in UTC, in ISO 8601 and in your own time zone — along with how far that is from now.

Is my timestamp in seconds or milliseconds?

Count the digits. Ten digits is seconds and covers dates from 2001 to 2286; thirteen is milliseconds, which is what JavaScript and Java produce; sixteen is microseconds, as Go’s UnixMicro and many tracing systems write; nineteen is nanoseconds. Below ten digits it is genuinely ambiguous, which is why the unit can be overridden here.

What is the Unix epoch?

Midnight UTC on 1 January 1970 — the moment everything is counted from. A timestamp is simply how many seconds have passed since then, which makes it a single number with no time zone, no calendar and nothing to translate.

Why does my date come out in 1970 or in the year 55000?

Because the unit was wrong. A millisecond timestamp read as seconds lands tens of thousands of years in the future; a second timestamp read as milliseconds lands about three weeks into January 1970. Both look like real dates, which is exactly why this page tells you which unit it used.

What is the year 2038 problem?

Systems that store a timestamp in a signed 32-bit integer run out of room on 19 January 2038, at 03:14:07 UTC, and wrap round to 1901. Anything storing 64 bits — which is nearly everything modern — is fine for longer than the sun has left. This page has no such limit.

Is anything sent anywhere?

No. The conversion is arithmetic done in your browser. That matters more than it sounds for this tool: the timestamps people paste come out of production logs, along with whatever is next to them on the line.

How do I make a Discord timestamp?

Paste your timestamp above, then copy one of the seven codes this page builds from it. Discord parses <t:SECONDS:STYLE> — SECONDS is a Unix timestamp in seconds, never milliseconds, and STYLE picks the format: t and T for time, d and D for date, f and F for both, and R for a relative form like "in 2 hours" that keeps updating as people read it. Discord renders the result in each reader’s own time zone and locale, so this page can only tell you what a style means, not what it will literally print.