Unix Timestamp Converter (Epoch ⇄ Date)

Convert a Unix timestamp such as 1700000000 to a readable date, or a date to a timestamp. Seconds, milliseconds, microseconds and nanoseconds are detected automatically from the number of digits.

Current Unix time

What is a Unix timestamp?

Unix time (also called epoch time or POSIX time) counts the number of seconds since 1970-01-01 00:00:00 UTC, the “Unix epoch”. Because it is a single number that does not depend on time zones or daylight saving time, it is used everywhere in software: databases, log files, HTTP APIs, cookies, and the exp / iat claims of a JWT.

Unix timestampDate (UTC)
01970-01-01 00:00:00
10000000002001-09-09 01:46:40
17000000002023-11-14 22:13:20
20000000002033-05-18 03:33:20
21474836472038-01-19 03:14:07 (max signed 32-bit value)
-11969-12-31 23:59:59

Seconds or milliseconds?

Present-day timestamps are 10 digits in seconds and 13 digits in milliseconds. JavaScript's Date.now() and Java's System.currentTimeMillis() return milliseconds; PHP's time(), Python's int(time.time()), Go's time.Now().Unix() and date +%s return seconds. This tool reads up to 11 digits as seconds, up to 14 as milliseconds, up to 17 as microseconds and anything longer as nanoseconds.

Get and convert Unix time in code

LanguageCurrent timestamp (seconds)Timestamp → date
JavaScriptMath.floor(Date.now() / 1000)new Date(ts * 1000).toISOString()
Pythonint(time.time())datetime.fromtimestamp(ts, tz=timezone.utc)
PHPtime()gmdate('c', $ts)
JavaInstant.now().getEpochSecond()Instant.ofEpochSecond(ts)
Gotime.Now().Unix()time.Unix(ts, 0).UTC()
Linux (GNU date)date +%sdate -u -d @1700000000
macOS (BSD date)date +%sdate -u -r 1700000000
PostgreSQLextract(epoch from now())to_timestamp(1700000000)
MySQLUNIX_TIMESTAMP()FROM_UNIXTIME(1700000000)

Convert a date to a Unix timestamp

To go the other way — from a date and time to epoch seconds — type the date into the box above (for example 2026-10-04 12:00:00), or use one of these. Every example below converts 2026-10-04 12:00:00 UTC and returns 1791115200.

Language / toolDate → Unix timestamp
JavaScriptMath.floor(new Date('2026-10-04T12:00:00Z').getTime() / 1000)
Pythonint(datetime(2026, 10, 4, 12, tzinfo=timezone.utc).timestamp())
PHPstrtotime('2026-10-04 12:00:00 UTC')
JavaInstant.parse("2026-10-04T12:00:00Z").getEpochSecond()
Gotime.Date(2026, 10, 4, 12, 0, 0, 0, time.UTC).Unix()
Linux (GNU date)date -d '2026-10-04 12:00:00 UTC' +%s
macOS (BSD date)date -j -u -f '%Y-%m-%d %H:%M:%S' '2026-10-04 12:00:00' +%s
Excel / Google Sheets=(A1-DATE(1970,1,1))*86400 (A1 holds a UTC date-time)

In Excel or Google Sheets, the reverse formula is =A1/86400+DATE(1970,1,1); format the cell as a date-time. Spreadsheets have no time zone, so the result is in UTC.

Epoch time, Unix time and POSIX time

These names mean the same thing. “Epoch” refers to the starting point, 1970-01-01 00:00:00 UTC, and an “epoch timestamp” is the number of seconds counted from it. Some systems use a different epoch — Windows FILETIME counts 100-nanosecond intervals since 1601, and Excel counts days since 1900 — so check which one a value uses before converting it.

Common durations in seconds

DurationSeconds
1 minute60
1 hour3600
1 day86400
1 week604800
30 days2592000
365 days31536000

Add these to a timestamp to compute expiry times, for example a token that expires in one hour has exp = iat + 3600.

Frequently asked questions

Why is my converted time off by several hours?

A Unix timestamp is always relative to UTC. If you read it as UTC but expected local time (or the other way round), the result is off by exactly your UTC offset — for example 5 hours for US Eastern Standard Time. Check the timezone selected above; the result list also shows UTC and your browser's local time side by side.

What is the Year 2038 problem?

Systems that store Unix time in a signed 32-bit integer can count only up to 2147483647, which is 2038-01-19 03:14:07 UTC. One second later the value overflows and wraps around to 1901-12-13 20:45:52 UTC. Using a 64-bit integer avoids the problem; most modern platforms already do.

How is the timezone handled when I enter a date?

A date without an offset, such as 2026-10-04 12:00:00, is read in the selected timezone. A date with an explicit offset, such as 2026-10-04T12:00:00Z or 2026-10-04T12:00:00+09:00, uses that offset instead.

Does Unix time include leap seconds?

No. Unix time assumes every day has exactly 86,400 seconds and ignores leap seconds, so this tool gives the same results as standard programming libraries.