Back to tool
Tools / Unix Timestamp
Convert

Unix Timestamp Converter

Epoch seconds or milliseconds to a readable date in any timezone, and back again — with the unit detected for you and the 2038 boundary flagged.

Timestamp Workspace

Seconds or milliseconds — the unit is detected from the digit count. 10 digits is seconds, 13 is milliseconds.
Formatted date
Seconds
Milliseconds
Day of week
Relative
ISO 8601 (UTC)
Day of year
ISO week
You might also need
Base64 Encoder & DecoderNumber Base ConverterSlug Generator

What a Unix timestamp is

A Unix timestamp is a count of seconds elapsed since 00:00:00 UTC on 1 January 1970 — the Unix epoch. That is the entire definition. It is a single integer, and it identifies an absolute instant in time that is the same everywhere on the planet.

Anatomy of a timestamp
1753027200

= 1,753,027,200 seconds after 1970-01-01T00:00:00Z
= 2025-07-20T16:00:00Z

The design is deliberately minimal. No timezone, no calendar rules, no daylight saving, no locale. Just a number that increments once per second. Every complication people associate with dates — leap years, month lengths, DST transitions, week numbering — is a presentation-layer concern applied when the integer is formatted for a human.

The single most useful thing to internalise: a timestamp has no timezone. It cannot "be in UTC" or "be in New York" — those describe how you chose to display it. This is why storing timestamps rather than formatted date strings eliminates an entire category of bug. The moment you write 2026-07-20 14:30 into a database column without a zone, you have lost information that cannot be recovered.

Seconds, milliseconds, or something else

Unix time is conventionally seconds, but plenty of systems use finer units, and mixing them is one of the most common date bugs in production code.

UnitDigits (current era)Used byIf misread as seconds
Seconds10Unix time(), PHP time(), Python time.time(), most databases
Milliseconds13JavaScript Date.now(), Java System.currentTimeMillis(), KafkaLands around the year 57,000
Microseconds16PostgreSQL internals, some tracing systemsFar future, usually overflows
Nanoseconds19Go UnixNano(), InfluxDBOverflows outright

The symptom of getting this wrong is unmistakable: a date in 1970 (milliseconds parsed as seconds and divided down, or seconds interpreted as milliseconds) or a date tens of thousands of years in the future. The converter above detects the unit from digit count and tells you what it assumed.

A worked example

Take 1753027200, ten digits, so seconds.

  1. Whole days: 1,753,027,200 ÷ 86,400 = 20,289 days, remainder 57,600 seconds
  2. Add the days to the epoch: 1970-01-01 plus 20,289 days = 2025-07-20
  3. Convert the remainder: 57,600 ÷ 3,600 = 16, with nothing left over
  4. Result: 2025-07-20T16:00:00Z

Had the division come out exact, with no remainder, the timestamp would land on midnight UTC — 1,752,969,600 is the midnight-UTC value for that same date. Any remainder is simply the time of day: divide by 3,600 for hours, then 60 for minutes. That is genuinely all there is to the conversion. The difficulty in date handling lies entirely in calendars and timezones, never in the epoch arithmetic itself.

The year 2038 problem

Systems storing Unix time in a signed 32-bit integer can represent at most 2,147,483,647 seconds. That limit is reached at 03:14:07 UTC on 19 January 2038. One second later the value overflows to negative and the date wraps to December 1901.

Modern 64-bit systems are unaffected — a signed 64-bit count runs out roughly 292 billion years from now. But embedded devices, older file formats, some database columns and plenty of legacy C code still use 32 bits. The converter flags any timestamp beyond the 32-bit range.

The mirror image is the negative timestamp: dates before 1970 are represented as negative integers. Legal and unambiguous, but many parsers and databases reject them, which is why historical dates are often better stored as calendar dates than epoch values.

Leap seconds and what Unix time ignores

Unix time assumes every day contains exactly 86,400 seconds. Actual UTC does not — leap seconds are occasionally inserted to keep clocks aligned with the Earth's rotation, and 27 have been added since 1972. Unix time simply does not represent them: during a leap second, the timestamp either repeats a value or the system smears the adjustment across several hours.

For almost all application code this is irrelevant. It matters if you are computing precise intervals across a leap second boundary, in which case you want TAI or a monotonic clock rather than wall-clock Unix time.

Reference points

TimestampDate (UTC)Significance
01970-01-01 00:00:00The Unix epoch
10000000002001-09-09 01:46:40One billion seconds
12345678902009-02-13 23:31:30Sequential-digit milestone
15000000002017-07-14 02:40:001.5 billion
20000000002033-05-18 03:33:20Two billion
21474836472038-01-19 03:14:0732-bit signed overflow

Frequently asked questions

Why does my timestamp show a different time than expected?
Nearly always a timezone display difference. The timestamp is an absolute instant; what changes is the zone you render it in. Check the display timezone selector above, and check what zone your server or database client is configured for — a mismatch between application and database zone is the classic cause.
What is the difference between UTC and GMT here?
For timestamp purposes, nothing. UTC is the modern precise standard maintained by atomic clocks; GMT is a timezone that happens to have the same offset. Unix time is defined against UTC. British Summer Time is UTC+1, so London is not on GMT for half the year — a frequent source of one-hour bugs.
Should I store timestamps or datetime strings?
Store an absolute instant — either an integer timestamp or a timezone-aware datetime type such as PostgreSQL's timestamptz. Never store a naive local datetime string without its offset; the information is unrecoverable, and DST transitions make some local times ambiguous or non-existent.
What is ISO 8601 and why prefer it?
A standard textual format: 2026-07-20T12:00:00Z. It is unambiguous, sorts correctly as a plain string, and includes the offset. When a timestamp must be human-readable — logs, APIs, config — ISO 8601 with an explicit offset is the right choice.
Why does my date-to-timestamp result shift by an hour?
Daylight saving. If you interpret a local time during a DST transition, the offset differs from the rest of the year. Use the "interpret as" selector to choose explicitly. For anything programmatic, working in UTC end to end and converting only at display time avoids the problem entirely.
Can timestamps be negative?
Yes — any date before 1970 is negative. It is valid, but support is inconsistent: some databases, APIs and 32-bit systems reject or mishandle them. For historical dates, a calendar date type is usually a better fit than epoch seconds.

How different systems represent time

Knowing which unit and type a system uses saves a great deal of debugging.

SystemFunctionUnit
JavaScriptDate.now()Milliseconds
Pythontime.time()Seconds (float)
PHPtime()Seconds
JavaSystem.currentTimeMillis()Milliseconds
Gotime.Now().Unix() / UnixNano()Seconds / nanoseconds
MySQLUNIX_TIMESTAMP()Seconds
PostgreSQLEXTRACT(EPOCH FROM ts)Seconds (with fraction)
Unix shelldate +%sSeconds

The JavaScript-to-everything-else boundary is where most bugs occur, because JavaScript is the odd one out in defaulting to milliseconds. A timestamp travelling from a browser to a Python or PHP backend needs dividing by 1,000, and forgetting is the single most common date bug in web development.

Practical rules that prevent time bugs

Related tools