Unix timestamp converter

Turn a Unix timestamp into a date you can read, or a date into a timestamp. It shows the current epoch time, handles seconds and milliseconds, and gives the result in UTC, your own time zone and ISO 8601.

Current Unix time

1796177199

Read as seconds. Milliseconds, microseconds and nanoseconds are detected by length.

UTC
Wednesday, December 2, 2026 02:06:39 UTC
Your time zone
Shown when the page has loaded
ISO 8601
2026-12-02T02:06:39Z
Relative
now
Seconds
1796177199
Milliseconds
1796177199000

Everything is converted in your browser.

How to convert a Unix timestamp

Paste the number into "Timestamp to date". You get the moment it stands for in UTC, in your own time zone, as an ISO 8601 string, and as a distance from now.

You don't have to say whether it's in seconds or milliseconds. The converter works it out from the length:

Digits Unit Example
10 Seconds 1700000000
13 Milliseconds 1700000000000
16 Microseconds 1700000000000000
19 Nanoseconds 1700000000000000000

To go the other way, pick a date and time under "Date to timestamp" and say whether you entered it in UTC or in your own time zone.

What a Unix timestamp is

A Unix timestamp is the number of seconds since midnight UTC on January 1, 1970. That starting point is called the epoch, so the number is also known as epoch time, POSIX time or Unix time.

The POSIX standard defines the epoch as "the time zero hours, zero minutes, zero seconds, on January 1, 1970 Coordinated Universal Time", and the timestamp as a value that "approximates the number of seconds that have elapsed since the Epoch".

Three properties make it useful:

  • It has no time zone. 1700000000 is the same instant everywhere. Time zones only come in when you display it
  • It's a plain number. Sorting, comparing and subtracting timestamps is simple arithmetic
  • It's compact. One integer where a formatted date needs a string

"Approximates" is there because of leap seconds. In POSIX's definition, every day counts as exactly 86,400 seconds, so leap seconds aren't counted.

Seconds or milliseconds?

This is where most timestamp bugs come from. Unix time is in seconds, but several platforms count in milliseconds.

Seconds Milliseconds
Unix date +%s, Python time.time(), PHP time(), Ruby Time.now.to_i, Go time.Now().Unix(), PostgreSQL and MySQL JavaScript Date.now(), Java System.currentTimeMillis()

If a date comes out in January 1970, a timestamp in seconds was read as milliseconds. If it comes out tens of thousands of years in the future, milliseconds were read as seconds. Multiply or divide by 1,000.

Get the current timestamp in your language

Language Seconds since the epoch
JavaScript Math.floor(Date.now() / 1000)
Python int(time.time())
Ruby Time.now.to_i
PHP time()
Go time.Now().Unix()
Java Instant.now().getEpochSecond()
C# DateTimeOffset.UtcNow.ToUnixTimeSeconds()
Swift Int(Date().timeIntervalSince1970)
Rust SystemTime::now().duration_since(UNIX_EPOCH)?.as_secs()
Bash date +%s
PostgreSQL SELECT extract(epoch FROM now())::bigint;
MySQL SELECT UNIX_TIMESTAMP();

Convert a timestamp in code

JavaScript

new Date(1700000000 * 1000).toISOString()   // "2023-11-14T22:13:20.000Z"
Math.floor(new Date("2023-11-14T22:13:20Z").getTime() / 1000)   // 1700000000

Python

from datetime import datetime, timezone
datetime.fromtimestamp(1700000000, tz=timezone.utc)   # 2023-11-14 22:13:20+00:00
int(datetime(2023, 11, 14, 22, 13, 20, tzinfo=timezone.utc).timestamp())   # 1700000000

Command line

date -u -d @1700000000    # Linux
date -u -r 1700000000     # macOS

In Python, pass a time zone. datetime.fromtimestamp() with no zone gives local time with no label on it, which is how a value ends up hours off on a server.

Timestamps worth knowing

Timestamp Date (UTC) Why it matters
0 Thursday, January 1, 1970, 00:00:00 The epoch
1000000000 Sunday, September 9, 2001, 01:46:40 One billion seconds
1700000000 Tuesday, November 14, 2023, 22:13:20 A handy test value
2000000000 Wednesday, May 18, 2033, 03:33:20 Two billion seconds
2147483647 Tuesday, January 19, 2038, 03:14:07 The largest value a signed 32-bit integer holds
4294967295 Sunday, February 7, 2106, 06:28:15 The largest value an unsigned 32-bit integer holds

The year 2038 problem

Systems that store timestamps as a signed 32-bit integer run out at 2147483647. One second later the number wraps around to a large negative value, which is a date in December 1901.

Modern systems use 64-bit timestamps, which last for billions of years. The risk is in old file formats, embedded devices and database columns declared as 32-bit integers. If you're designing a schema, use a 64-bit integer or a native timestamp type.

Timestamps in license keys and tokens

Expiry dates in software are usually Unix timestamps.

  • JSON Web Tokens. The exp, nbf and iat claims are what the JWT standard calls a NumericDate: seconds since the epoch, per RFC 7519. Paste an exp value above to see when a token runs out
  • Trials and subscriptions. A license that ends on a date stores that date as a timestamp and compares it with the current time
  • Signed license files. An offline license carries its expiry inside the signed data, so it can't be edited

Two things to get right when your app checks an expiry:

  • Compare in UTC. A timestamp has no time zone, so never convert to local time before comparing
  • Don't trust the device's clock on its own. A customer can set it back. Checking against a server, or noticing that the clock has gone backwards since the last run, closes that hole

Checking against a server is what a licensing service does for you. The guides to subscription licenses and license keys cover the rest.

Common questions about Unix time

What is a Unix timestamp?

The number of seconds since 00:00:00 UTC on January 1, 1970, not counting leap seconds. It identifies a moment in time with a single number.

What is epoch time?

Another name for the same thing. "The epoch" is the starting point, January 1, 1970, and epoch time is the count of seconds since then.

How do I convert a Unix timestamp to a date?

Paste it into the converter above. In code, multiply by 1,000 and pass it to new Date() in JavaScript, or use datetime.fromtimestamp(ts, tz=timezone.utc) in Python.

Is a Unix timestamp in seconds or milliseconds?

Unix time itself is in seconds, which is 10 digits for current dates. JavaScript and Java commonly use milliseconds, which is 13 digits. Count the digits to tell.

Does a Unix timestamp have a time zone?

No. It counts seconds from a fixed instant in UTC, so it's the same number everywhere in the world. A time zone is applied only when the timestamp is shown as a date.

Why does my timestamp show a date in 1970?

A value in seconds was treated as milliseconds, so it looks like a moment shortly after the epoch. Multiply it by 1,000.

What happens in 2038?

Signed 32-bit timestamps overflow at 03:14:07 UTC on January 19, 2038. Systems using 64-bit timestamps aren't affected.

Can a Unix timestamp be negative?

Yes. Negative values are moments before 1970. -86400 is December 31, 1969.

What is the current Unix timestamp?

It's the number at the top of this page, which updates every second.