Skip to content
cliplimeClipLime

Convert Unix timestamps to dates and back

Seconds or milliseconds in, UTC and local time out, with the year 2038 limit explained.

Runs in your browser, nothing is sent anywhere

Right now

Unix seconds

...

Unix milliseconds

...

Reading the clock...

Time zone

Used for the readable date on the left, and for dates on the right that have no offset of their own. UTC is always shown.

Timestamp to date

Seconds, milliseconds, microseconds or nanoseconds since 1970-01-01 UTC.

Unit

Type a timestamp to see the date.

Date to timestamp

ISO 8601 like 2023-11-14T22:13:20Z, or 2023-11-14 22:13:20, or an RFC 2822 date. Without an offset it is read in UTC.

Type a date to get its timestamp.

The year 2038 problem

Many older systems keep Unix time in a signed 32-bit integer. The largest value it can hold is 2147483647, which is 2038-01-19 03:14:07 UTC. One second later the number wraps to a negative value, which reads as 1901-12-13. Systems with 64-bit time, such as 64-bit builds of Linux, macOS and Windows, and JavaScript, are not affected. Unsigned 32-bit time lasts until 2106-02-07.

At a glance

What it does
Turns a Unix timestamp into a date, and a date into a timestamp, as you type.
Units
Seconds, milliseconds, microseconds and nanoseconds. Auto mode guesses the unit from the number of digits.
Time zones
UTC plus every IANA zone your browser knows, such as Europe/Berlin or Asia/Tokyo, with daylight saving applied for you.
Formats
ISO 8601, RFC 2822, the HTTP header date, a readable date, the day of the year and the ISO week number.
Live clock
The current Unix time in seconds and milliseconds, with a pause button so you can copy a value that holds still.
Year 2038
Flags any timestamp that does not fit in a signed 32-bit integer.
Privacy
Runs in your browser. The numbers and dates you type are never sent anywhere.

How to do it

  1. 1

    Paste a timestamp

    Type a number like 1700000000 or 1700000000123. Auto mode picks seconds, milliseconds, microseconds or nanoseconds from the digits. Choose a unit yourself if the guess is wrong.

  2. 2

    Pick a time zone

    Choose a zone to see the same moment as local time. UTC is always shown next to it.

  3. 3

    Copy the format you need

    Each line has its own Copy button: ISO 8601, RFC 2822, the HTTP date, or the seconds and milliseconds forms.

  4. 4

    Or start from a date

    Type a date such as 2023-11-14 22:13:20 in the right panel to get the timestamp. Dates with an offset or a Z are read exactly as written.

What a Unix timestamp counts

A Unix timestamp is the number of seconds that have passed since 1970-01-01 00:00:00 UTC, a moment called the epoch. It is one number for the whole planet, so two servers on different continents agree on it without caring about time zones.

That makes it easy to store, sort and subtract, which is why logs, databases, tokens and APIs use it. To get a duration, subtract two timestamps. To show a date to a person, turn the number into text for their time zone, which is what this page does.

Unix time pretends every day has exactly 86,400 seconds. Leap seconds are not counted, so for almost all software they make no difference.

Languages and tools count in different units:

  • Seconds: C, PHP time(), Go Unix(), Python time.time() as a decimal, and the shell command date +%s.
  • Milliseconds: JavaScript Date.now(), Java System.currentTimeMillis() and many JSON APIs.
  • Microseconds: Parquet and Arrow timestamp columns, and the Chrome trace format.
  • Nanoseconds: Go UnixNano(), OpenTelemetry timestamps and the Linux clock_gettime call.

Seconds or milliseconds? How the guess works

A timestamp for a date in recent decades has a predictable length: 10 digits for seconds, 13 for milliseconds, 16 for microseconds and 19 for nanoseconds. Auto mode reads anything below 100 billion as seconds, below 100 trillion as milliseconds, below 100 quadrillion as microseconds, and anything larger as nanoseconds.

The guess can be wrong for dates close to 1970. The number 86400000 is one day in milliseconds, but it has only 8 digits, so Auto reads it as seconds and shows a date in September 1972. When you know the unit, pick it yourself. The page always says which unit it used and why.

Negative timestamps are dates before 1970. For example, -86400 is 1969-12-31 00:00:00 UTC.

The year 2038 problem

A signed 32-bit integer stops at 2,147,483,647. As a timestamp that is 2038-01-19 03:14:07 UTC. One second later the value wraps around to -2,147,483,648, which a program reads as 1901-12-13 20:45:52 UTC.

Software that keeps time in 64 bits is not affected. That covers current JavaScript, Python, Java and Go, and the 64-bit builds of Linux, macOS and Windows. Software that still stores seconds in a signed 32-bit field is affected: some embedded devices, older file formats, and database columns such as the MySQL TIMESTAMP type, which ends at that same second. Systems that read the field as unsigned last until 2106-02-07 06:28:15 UTC.

Paste any timestamp and this page tells you whether it fits. The 2038 limit example shows the last good second.

Time zones and daylight saving

A timestamp has no time zone. 1700000000 is the same instant in Tokyo and in Toronto. Only the way it is written changes: 22:13:20 in UTC, 23:13:20 in Berlin and 17:13:20 in New York, all on 14 November 2023.

Going the other way needs a zone, because "2023-11-14 22:13:20" means a different instant in each place. The right panel reads dates that carry an offset on their own, such as Z or +01:00, and uses the zone you picked for dates that do not.

Daylight saving creates two awkward cases. When clocks jump forward, the skipped hour does not exist, so a time inside it is moved to the nearest real moment. When clocks go back, the repeated hour happens twice, and the page uses the first one. In both cases it tells you.

Questions people ask

What is the Unix epoch?

The epoch is 1970-01-01 00:00:00 UTC, the moment a Unix timestamp counts from. A timestamp of 0 is that instant, and negative timestamps are earlier dates.

How do I convert a Unix timestamp to a date in code?

In JavaScript, new Date(seconds * 1000).toISOString() gives an ISO 8601 string, and new Date(ms) takes milliseconds directly. In Python, datetime.fromtimestamp(seconds, tz=timezone.utc) does it. On Linux, date -u -d @1700000000 prints the date, and on macOS the same job is date -u -r 1700000000.

Why is my timestamp 13 digits long?

It is almost certainly in milliseconds. Seconds have 10 digits for every date from September 2001 to November 2286. JavaScript, Java and many web APIs return milliseconds, so divide by 1000 if a tool expects seconds.

Does a Unix timestamp depend on the time zone?

No. It counts from a fixed instant in UTC, so it is the same everywhere. A time zone only matters when you turn the timestamp into a date for people to read, or when you read a date that has no offset.

What happens on 19 January 2038?

Clocks keep working. Only software that stores seconds in a signed 32-bit integer breaks, because the value overflows and reads as a date in 1901. Software using 64-bit time is not affected.

Is anything I type sent to a server?

No. Every conversion happens in your browser with JavaScript and the time zone data your browser already has. The timestamps and dates you enter never leave the page.