Skip to content

Unix timestamp converter

Convert Unix time to dates and back.

Unix time now, in seconds

ms 0

to 2038 to 2106

Direction

Time zone rules come from your browser's copy of the IANA time zone database.

What Unix time is

A Unix timestamp is a count of the seconds that have passed since 00:00:00 UTC on January 1, 1970, a moment called the epoch. Because it is one number with no time zone and no calendar rules attached, computers favor it for storing and comparing moments.

The same instant is 22:13 in London and 07:13 the next day in Tokyo, but it has exactly one timestamp; the time zone you pick, and daylight saving time, only change how the date is displayed. To compare the same moment across cities, use the time zone converter; to count the days between two dates, the date calculator; for hours and minutes worked, the time calculator.

Seconds, milliseconds and more

The original Unix counter is in seconds, but many systems count finer. JavaScript's Date.now() returns milliseconds, and some databases and tracing tools use microseconds or nanoseconds. The digit count tells them apart.

Digit count tells the unit
UnitDigits todayExample for 2023-11-14 22:13:20 UTCCommon in
Seconds 10 1700000000 Unix, Python, PHP, APIs, JWT claims
Milliseconds 13 1700000000000 JavaScript, Java, Kafka
Microseconds 16 1700000000000000 Some databases, Python datetime
Nanoseconds 19 1700000000000000000 Go, tracing and metrics systems

Source: Calculated; unit conventions from the language documentation listed below.

Auto mode's rule is right for every date from 1973 to the year 5138; for early-1970s dates in milliseconds, choose "ms". A date in January 1970 usually means a seconds value read as milliseconds.

Timestamps worth knowing

Round numbers and what they are
TimestampUTC date and timeWhy it matters
0 1970-01-01 00:00:00 The epoch
946684800 2000-01-01 00:00:00 Start of the year 2000
1000000000 2001-09-09 01:46:40 The billionth second
1234567890 2009-02-13 23:31:30 A favorite of programmers
2000000000 2033-05-18 03:33:20 The two-billionth second
2147483647 2038-01-19 03:14:07 Last second a signed 32-bit integer can hold
4294967295 2106-02-07 06:28:15 Last second an unsigned 32-bit integer can hold

Source: calculated from the definition of Unix time.

Paste any of these into the tool to check it. Negative numbers work too: they are moments before 1970.

The year 2038 problem

Older systems store the timestamp in a signed 32-bit integer. Its largest value is 2,147,483,647, which is reached at 03:14:07 UTC on January 19, 2038. One second later the counter has no room left, the top bit flips, and the value wraps to negative 2,147,483,648, which a program reads as 20:45:52 UTC on December 13, 1901.

03:14:07 UTC, 19 Jan 2038 = 2,147,483,647 01111111111111111111111111111111 + 1 second The sign bit flips: -2,147,483,648 = 20:45:52 UTC, 13 Dec 1901 10000000000000000000000000000000
The shaded first byte holds the sign bit. All 32 bits are shown, in four bytes.

The fix is a wider integer: a signed 64-bit counter of seconds does not run out for about 292 billion years. Linux added 64-bit time on 32-bit systems in version 5.6. What remains at risk are old embedded devices, file formats and database columns that hard-code 32 bits; unsigned 32-bit fields push the limit to February 7, 2106.

Get the timestamp in code

JavaScript returns milliseconds, so it divides by 1,000.

Current Unix time in seconds
LanguageCode
JavaScript Math.floor(Date.now() / 1000)
Python int(time.time())
Java Instant.now().getEpochSecond()
C# DateTimeOffset.UtcNow.ToUnixTimeSeconds()
Go time.Now().Unix()
PHP time()
Ruby Time.now.to_i
Rust SystemTime::now().duration_since(UNIX_EPOCH)?.as_secs()
Bash date +%s
SQL (PostgreSQL) SELECT EXTRACT(EPOCH FROM now())::bigint;

Source: each language's official documentation (see Sources). Python needs import time; Rust needs the std::time items imported.

To go the other way, Python has datetime.fromtimestamp(ts, tz=timezone.utc), JavaScript has new Date(ts * 1000), and the command line on Linux has date -d @1700000000.

Leap seconds

Unix time ignores leap seconds. POSIX defines the count so that every day has exactly 86,400 seconds, even though Earth's rotation is not perfectly steady and the international timekeeping bodies have inserted a leap second into UTC 27 times since 1972, the last on December 31, 2016. The result: during a leap second, Unix time either repeats a value or, on systems that "smear" the extra second across a few hours, runs slightly slow.

Where this stands

The IERS, which announces leap seconds, said in its July 6, 2026 bulletin that no leap second will be added at the end of December 2026. In 2022 the General Conference on Weights and Measures decided to enlarge the allowed gap between UTC and Earth rotation time in or before 2035, which would stop leap seconds for at least a century.

So a timestamp for a date after 2016 is 27 seconds smaller than the count of physical seconds since 1970, by design.

Mistakes that cost an hour

  • Forgetting JavaScript counts months from 0. new Date(2026, 0, 1) is January 1. Passing a timestamp avoids this.
  • Building a local time without a zone. A date such as "2026-03-08 02:30" may not exist in a zone that moves its clocks forward that night. The tool shifts it ahead by the missing hour, as most calendars do.

Common questions

Is anything sent to a server?

No. The values you type or convert stay in your browser and are not sent by the page. The site does count page views.

Sources

Last reviewed November 9, 2026.

Related tools