Unix Timestamp Converter

Convert Unix timestamps in seconds, milliseconds, microseconds or nanoseconds to dates, and dates back to timestamps.

Current Unix time

Converts a Unix timestamp to a date โ€” in UTC, in your time zone and in any other โ€” and a date back to timestamps in seconds, milliseconds, microseconds and nanoseconds. It reads the unit from the number's length, keeps nanoseconds exact, and converts a pasted list at once.

How timestamps are read

A Unix timestamp counts seconds since 00:00:00 UTC on 1 January 1970, the Unix epoch; earlier instants are negative. POSIX defines it without leap seconds: every day is exactly 86,400 seconds, so a timestamp maps to a date by arithmetic alone. Timestamps are the same everywhere; only the date and time shown for one depends on the time zone.

Systems store timestamps in different units, and the digits give them away. Auto reads up to 11 digits as seconds, 12 to 14 as milliseconds, 15 to 17 as microseconds and 18 or more as nanoseconds, counting the digits without a minus sign; the result says which it chose, and the unit can be set by hand. A decimal fraction is kept, to the nanosecond.

Dates are read only in RFC 3339 form โ€” a date, a time and an offset, such as 2025-01-01T05:30:00+05:30 or 2025-01-01T00:00:00Z. Browsers disagree on what other forms mean, so they are rejected rather than guessed. Instants must lie within 8.64 ร— 10ยนโต milliseconds of the epoch, the range JavaScript dates cover (years โˆ’271,821 to 275,760).

Examples

A timestamp in seconds

Input
1735689600
Read as
seconds
UTC
2025-01-01T00:00:00Z
India
2025-01-01T05:30:00+05:30
New York
2024-12-31T19:00:00-05:00

The same instant is midnight in London and already morning in India, while New York is still on the evening before.

Milliseconds from JavaScript

Input
1735689600123
Read as
milliseconds
UTC
2025-01-01T00:00:00.123Z

Date.now() gives milliseconds, 13 digits for any date between 2001 and 2286.

Before 1970

Input
-1
UTC
1969-12-31T23:59:59Z

One second before the epoch.

Notable timestamps

Timestamps in seconds and the instants they name
TimestampUTCNote
01970-01-01T00:00:00ZThe epoch
10000000002001-09-09T01:46:40ZThe first 10-digit timestamp
12345678902009-02-13T23:31:30ZThe digits 1 to 0 in order
20000000002033-05-18T03:33:20ZTwo billion seconds
21474836472038-01-19T03:14:07ZThe largest signed 32-bit value: where 32-bit clocks overflow
42949672952106-02-07T06:28:15ZThe largest unsigned 32-bit value

Frequently asked questions

JavaScript
Math.floor(Date.now() / 1000)
Python
import time; int(time.time())
PostgreSQL
SELECT EXTRACT(EPOCH FROM now())::bigint;
MySQL
SELECT UNIX_TIMESTAMP();
Shell (Linux, macOS)
date +%s
A timestamp in seconds read as milliseconds lands a few weeks after the epoch: 1735689600 as milliseconds is 1970-01-21T02:08:09.6Z. The other way round, a millisecond value read as seconds lands tens of thousands of years ahead. Auto picks the unit by the number of digits, so check the unit the result names.

See also