Date & Time Tools

Unix Timestamp Converter

Convert Unix epoch timestamps to UTC and local dates, ISO 8601 and RFC 2822, or dates back to seconds and milliseconds.

  • Free
  • No sign-up
  • Runs in your browser

Unix Timestamp

Current timestamp (seconds) –
Milliseconds –

Timestamp to date

10 digits = seconds, 13 digits = milliseconds. Negative values are dates before 1970.

Date and time
--

Date to timestamp

Runs in your browser. Your inputs never leave your device.

Quick Answer

A Unix timestamp is the number of seconds since 1970-01-01 00:00:00 UTC, not counting leap seconds. 1700000000 is 2023-11-14T22:13:20Z, and the same instant in milliseconds is 1700000000000. A 10-digit number is almost always seconds and a 13-digit number milliseconds; this converter detects which one you pasted.

How to Use

  1. Paste the timestamp. Enter the number in seconds or milliseconds. The unit is detected from the number of digits, or choose it from the Unit menu.
  2. Read the date. See the date in UTC and your local time, plus ISO 8601, RFC 2822 and how long ago or how far ahead it is.
  3. Convert a date back. Pick a date and time, choose whether it is UTC or your local time, and read the timestamp in seconds and milliseconds.

The Year 2038 Problem Explained

Early Unix systems stored time in a time_t that was a signed 32-bit integer. The largest number it can hold is 2,147,483,647, and that many seconds after the epoch is 03:14:07 UTC on Tuesday, 19 January 2038. One second later the counter overflows to −2,147,483,648, which software reads as 20:45:52 UTC on 13 December 1901.

This is similar to the Y2K bug, but harder to spot: the problem is not in how years are written but in the binary width of a number deep inside file systems, databases, embedded devices and file formats. Calculations that look into the future, such as 30-year loan schedules, certificate expiry dates or long-term scheduling, can fail long before 2038.

  • Already fixed: 64-bit Linux, macOS, Windows and modern languages use 64-bit time, which lasts for about 292 billion years. Linux kernel 5.6 added 64-bit time for 32-bit architectures too.
  • Still at risk: old 32-bit embedded systems, MySQL TIMESTAMP columns (limited to 2038-01-19 03:14:07 UTC), file formats with 32-bit time fields, and code that casts timestamps to int.
  • How to check: convert 2147483648 above. If your system shows a 2038 date for it, it handles times past the limit.

Timestamps in Common Languages

Getting and converting Unix timestamps in code
LanguageCurrent timestampTimestamp to date
JavaScriptMath.floor(Date.now() / 1000)new Date(ts * 1000)
Pythonint(time.time())datetime.fromtimestamp(ts, timezone.utc)
PHPtime()date('c', $ts)
JavaInstant.now().getEpochSecond()Instant.ofEpochSecond(ts)
Shell (GNU)date +%sdate -u -d @1700000000
SQL (PostgreSQL)extract(epoch from now())to_timestamp(1700000000)

Everything on this page runs in your browser: the current timestamp comes from your device clock, and the local time uses your device's time zone setting. If the live counter looks wrong, check that your computer's clock is synchronised.

Epoch Conversion Formula

Date (UTC) = 1970-01-01T00:00:00Z + timestamp seconds · Timestamp = (Date − 1970-01-01T00:00:00Z) in seconds

Every Unix day is exactly 86,400 seconds, so the date is found by dividing by 86,400 to get the day number since 1 January 1970 and using the remainder as the time of day. Milliseconds are seconds × 1,000. The unit is detected from the size of the number: below 100,000,000,000 is treated as seconds (that reaches the year 5138), up to 14 digits as milliseconds, then microseconds and nanoseconds.

  • Seconds: The classic Unix time used by most servers, databases and the date command.
  • Milliseconds: Used by JavaScript (Date.now()), Java (System.currentTimeMillis()) and many APIs: seconds × 1,000.
  • Local time: The same instant shown with your device's time zone offset. The timestamp itself never changes with the time zone.

Worked Examples

The Unix epoch

Timestamp: 0

  1. 0 seconds after the epoch

Result: 1970-01-01T00:00:00Z (Thursday, 1 January 1970, midnight UTC)

A 10-digit timestamp in seconds

Timestamp: 1700000000

  1. 1,700,000,000 ÷ 86,400 = 19,675 whole days, remainder 80,000 seconds
  2. Day 19,675 after 1 January 1970 is 14 November 2023
  3. 80,000 seconds = 22 hours 13 minutes 20 seconds

Result: 2023-11-14T22:13:20Z (Tue, 14 Nov 2023 22:13:20 +0000)

A 13-digit timestamp in milliseconds

Timestamp: 1700000000000

  1. 13 digits, so it is read as milliseconds
  2. 1,700,000,000,000 ÷ 1,000 = 1,700,000,000 seconds

Result: 2023-11-14T22:13:20Z, the same instant as the previous example

The last second of 32-bit time

Timestamp: 2147483647 (2³¹ − 1)

  1. The largest value a signed 32-bit integer can hold
  2. 2,147,483,647 seconds after the epoch

Result: 2038-01-19T03:14:07Z, one second before 32-bit clocks overflow

Common Mistakes to Avoid

  • Treating milliseconds as seconds: Passing 1700000000000 to a function that expects seconds gives a date about 54,000 years in the future, and passing seconds to JavaScript's new Date() gives a date in January 1970. Count the digits: 10 for seconds, 13 for milliseconds.
  • Thinking a timestamp has a time zone: A Unix timestamp is always counted from midnight UTC, so the same number is the same instant everywhere. Only the way it is displayed changes. If two systems disagree by whole hours, one of them is formatting in local time.
  • Building a timestamp from local time by mistake: Converting "2026-03-01 09:00" without saying which time zone it is in silently uses the computer's own zone. Choose UTC or local time explicitly when converting a date to a timestamp.
  • Storing time in a signed 32-bit integer: A signed 32-bit seconds counter overflows after 2038-01-19T03:14:07Z and wraps to December 1901. Use 64-bit integers (BIGINT, int64, time_t on modern 64-bit systems) for anything that might store dates past 2038, including expiry dates and mortgages.
  • Expecting leap seconds: Unix time ignores leap seconds: every day is exactly 86,400 seconds. Subtracting two timestamps therefore gives elapsed civil time, which can differ from true elapsed seconds by the 27 leap seconds added since 1972.

Frequently Asked Questions

What is a Unix timestamp?

It is the number of seconds that have passed since 00:00:00 UTC on 1 January 1970 (the Unix epoch), ignoring leap seconds. It is also called epoch time, POSIX time or Unix time.

How do I convert a Unix timestamp to a date?

Paste it into the converter above. In code: JavaScript new Date(ts * 1000).toISOString(); Python datetime.fromtimestamp(ts, tz=timezone.utc); on Linux date -u -d @1700000000; in Excel =ts/86400 + DATE(1970,1,1).

How do I get the current Unix timestamp?

The live counter at the top of the tool shows it in seconds and milliseconds. In code: Math.floor(Date.now() / 1000) in JavaScript, int(time.time()) in Python, date +%s in a Unix shell.

Is my timestamp in seconds or milliseconds?

Count the digits. Current timestamps in seconds have 10 digits (1,7xx,xxx,xxx) and in milliseconds 13 digits. The converter detects this automatically, and you can force a unit with the Unit menu.

What is the Year 2038 problem?

Systems that store Unix time in a signed 32-bit integer can count only up to 2,147,483,647 seconds, which is 03:14:07 UTC on 19 January 2038. One second later the value overflows to a negative number and the date jumps back to 13 December 1901. 64-bit time values avoid this.

Does a Unix timestamp depend on the time zone?

No. The timestamp is the same everywhere at the same instant. Time zones only matter when you turn it into a readable date, which is why the converter shows both UTC and your local time.

Can a Unix timestamp be negative?

Yes. Negative values are dates before 1970: −86400 is 31 December 1969 00:00:00 UTC. Most modern languages handle them, but some older systems and spreadsheets do not.

What is the difference between ISO 8601 and RFC 2822 dates?

ISO 8601 (2023-11-14T22:13:20Z) is the sortable format used in JSON and APIs. RFC 2822 (Tue, 14 Nov 2023 22:13:20 +0000) is the format used in email Date headers and many HTTP and RSS feeds.

Sources & References