Unix Timestamp Converter

See the current Unix time live, convert epoch seconds or milliseconds to a readable date, or turn a date into a timestamp.

Runs 100% in your browser. Nothing you paste is uploaded or stored.

Current Unix time

—

Timestamp → date

Date → timestamp

How to use the Unix timestamp converter

  1. Paste a Unix timestamp. The converter recognises whether it is in seconds or milliseconds.
  2. Read the date in UTC, in your local time zone and in ISO 8601 format.
  3. To go the other way, pick a date and time and copy the resulting timestamp.

Conversions are calculated in your browser using your device's clock and time zone settings; nothing is sent to or stored on a server.

What is a Unix timestamp?

A Unix timestamp (also called epoch time or POSIX time) is the number of seconds that have elapsed since the Unix epoch: 1970-01-01T00:00:00Z, midnight UTC on 1 January 1970. Dates before the epoch are negative numbers.

Timestamps are popular because they are a single integer, independent of time zones and daylight saving time, easy to compare and sort, and compact to store. Converting to a local time is a display concern handled at the last moment.

1700000000      → 2023-11-14T22:13:20Z
0               → 1970-01-01T00:00:00Z
-86400          → 1969-12-31T00:00:00Z

Seconds vs milliseconds

Unix tools, PHP, Python's time.time() and most databases use seconds. JavaScript's Date.now(), Java's System.currentTimeMillis() and many JSON APIs use milliseconds. For present-day dates a seconds value has 10 digits and a milliseconds value has 13. Mixing them up is the single most common timestamp bug:

new Date(1700000000)          // Tue Jan 20 1970 (treated as ms!)
new Date(1700000000 * 1000)   // Tue Nov 14 2023

Leap seconds are ignored

Unix time assumes every day has exactly 86,400 seconds. When a leap second is inserted into UTC, Unix time does not count it, so the timestamp does not equal the true number of elapsed SI seconds since 1970. For almost all applications this is irrelevant, and it keeps date arithmetic simple.

Common pitfalls

The Year 2038 problem

Systems that store timestamps as a signed 32-bit integer can count only up to 2,147,483,647, which is 2038-01-19T03:14:07Z. One second later the value overflows and wraps around to a negative number, representing a date in December 1901. Modern operating systems and languages use 64-bit time, but embedded devices, old file formats and database columns declared as 32-bit integers remain at risk. Use 64-bit integers or native date/time types for anything that may store future dates.

Local time sneaking in

Parsing a date string without a time zone, such as 2024-03-10 02:30, uses the machine's local zone and can produce different timestamps on different servers, or an invalid time during a daylight saving transition. Always include an offset or Z.

ISO 8601

For human-readable interchange, ISO 8601 (and its internet profile, RFC 3339) is the standard: 2023-11-14T22:13:20Z or 2023-11-14T23:13:20+01:00. Like timestamps, ISO 8601 strings in UTC sort correctly as plain text.

Getting the current timestamp in code

EnvironmentSeconds since epoch
Shell (Linux, macOS)date +%s
Pythonimport time; int(time.time())
JavaScriptMath.floor(Date.now() / 1000)
PHPtime()
MySQLSELECT UNIX_TIMESTAMP();
PostgreSQLSELECT EXTRACT(EPOCH FROM now());

To convert a timestamp back to a date on the command line, use date -u -d @1700000000 on Linux (GNU date) or date -u -r 1700000000 on macOS.

Tip: JWTs store exp, iat and nbf as Unix timestamps in seconds. The JWT decoder converts them for you. For time-ordered identifiers that embed a millisecond timestamp, see the UUID v7 generator.

Frequently asked questions

Is a Unix timestamp the same in every time zone?

Yes. It counts seconds since a fixed instant in UTC, so at any given moment it is identical everywhere. Only its conversion to local wall-clock time differs.

How can I tell seconds from milliseconds?

Count the digits. Current dates are 10 digits in seconds and 13 in milliseconds. A "date" in January 1970 usually means a seconds value was read as milliseconds; a date tens of thousands of years in the future means the reverse.

What happens in 2038?

Only software that stores time in a signed 32-bit integer breaks. 64-bit timestamps will not overflow for billions of years.

Can a Unix timestamp be negative?

Yes. Negative values represent moments before 1 January 1970, though some older systems and APIs do not accept them.

Copied to clipboard