MultiTools
Time

Unix Timestamp Converter

Translate Unix time to dates and back.

  • Local by default
  • No signup
  • AI is opt-in

Right now

UTC and your local zone

Unix seconds

—

Unix milliseconds

—

Timestamp → date

Local time —
UTC —
Selected zone —
ISO 8601 —
RFC 2822 —
Relative —

Date → timestamp

Unix seconds

—

Unix milliseconds

—

Dates are interpreted in your browser's local timezone.

Unix time is the number of seconds since 1 January 1970 UTC. It is compact, timezone-free and easy to compare — and the source of endless confusion because JavaScript uses milliseconds, databases disagree, and humans expect local time.

What Unix time actually counts

Unix time is the number of seconds elapsed since 1970-01-01T00:00:00Z, ignoring leap seconds. It is a single instant with no timezone attached, which is exactly why it is good for storage: rendering it for a user is a separate, later decision. The same number means the same moment in Tokyo, Berlin and São Paulo.

Seconds versus milliseconds

Ten-digit values are seconds. Thirteen-digit values are milliseconds — the unit JavaScript uses in Date.now(). The 1,000× difference is the cause of a whole genre of bugs: a millisecond value passed to a function expecting seconds lands roughly 50,000 years in the future, and a seconds value passed to JavaScript renders as 1970.

Math.floor(Date.now() / 1000)  // seconds, most APIs
Date.now()                      // milliseconds, JavaScript
new Date(1764153600 * 1000)     // correct conversion

This converter detects the unit by digit count and tells you which one it assumed, so you can spot a mismatch instead of silently getting the wrong century.

The bug in one line

The failure is easy to reproduce. A seconds value passed to new Date() is read as milliseconds, and a milliseconds value that was divided first is read as milliseconds again. Both produce a date in January 1970, which looks like a parsing error rather than a unit error.

const seconds = 1764153600;      // 10 digits
new Date(seconds)                // 1970-01-21 — wrong
new Date(seconds * 1000)         // intended date — correct

const millis = 1764153600000;    // 13 digits
new Date(millis)                 // correct
new Date(millis / 1000)          // 1970-01-21 — wrong

The defensive habit is to name the variable after its unit — expiresAtSeconds, createdAtMs — and convert once, at the boundary where data enters your code. Guessing from digit count works for current dates, but not for every value in history.

The 2038 problem

Systems storing Unix time in a signed 32-bit integer overflow on 19 January 2038, wrapping to a negative value and rendering as December 1901. Modern stacks use 64-bit values or ISO strings and are unaffected, but embedded devices, older databases and long-lived file formats are not. If you own data that must outlive 2038 — expiry dates, certificate validity, scheduled payments — store it as text or 64-bit now.

Storage choices that age well

In PostgreSQL, timestamptz stores an instant in UTC and converts it to the session zone on read; timestamp without a zone stores a wall-clock value with no offset, which invites misreading. In MySQL, TIMESTAMP is the 32-bit type with the 2038 limit, while DATETIME has a much wider range but stores no zone. Neither default is wrong — mixing them in one schema is.

A plain BIGINT epoch column is the least surprising option across languages: no zone, no parsing rules, and natural ordering. ISO 8601 text is readable and sortable too, as long as it always carries Z or an explicit offset. Avoid strings such as 2026-11-26 09:00:00 with no zone, because every reader will assume a different one.

Timezones, display and parsing

A timestamp has no timezone, but display always does. The same instant is "09:00" in Berlin and "00:00" in Los Angeles on the same day — or a different day entirely, which is why date boundaries are a classic reporting bug. Store UTC, convert at the edges, and show the zone name in any interface where a deadline matters.

Parsing is the other trap. new Date("2024-03-01") is interpreted as UTC midnight, while new Date("2024-03-01T00:00:00") is interpreted as local midnight. That one character difference can shift a date by a day for half the planet.

DST and the hour that happens twice

When clocks fall back, the local time 02:30 occurs twice; when they spring forward, 02:30 does not exist at all. A scheduler that stores only local wall-clock time can run a job twice or skip it. Storing the UTC instant removes the ambiguity for past events. For future appointments, store the zone identifier (Europe/Berlin, America/New_York) alongside the instant, because governments change DST rules and a fixed offset cannot follow them.

ISO 8601 and RFC 2822

ISO 8601 (2026-11-26T09:00:00Z) is the format to use in APIs and logs: sortable, unambiguous and widely parsable. RFC 2822 (Thu, 26 Nov 2026 09:00:00 GMT) survives mainly in email headers and HTTP dates. Prefer ISO everywhere you have a choice.

Frequently asked questions

What is a Unix timestamp?

The number of seconds since 1 January 1970 00:00:00 UTC. It represents a single moment without any timezone, which makes it ideal for storage and comparison.

Why does JavaScript use milliseconds?

That is the unit of Date.now() and Date constructor values in JavaScript. Convert with Math.floor(Date.now() / 1000) when an API expects seconds. Passing milliseconds to a seconds-based API is the most common timestamp bug.

How do I get the current timestamp in Python?

Use time.time() for a float in seconds, or int(time.time()) for whole seconds. For milliseconds, int(time.time() * 1000). In JavaScript, Date.now() already returns milliseconds.

Does Unix time account for leap seconds?

No. Unix time ignores leap seconds; it is a linear count of seconds. This means it can differ from UTC by a second or so, which matters only for very precise astronomy or timekeeping work.

What happens to timestamps in 2038?

Only 32-bit signed storage overflows, wrapping to 1901. Values stored as 64-bit integers or text are unaffected. Audit embedded systems and legacy database columns if the data must remain valid past January 2038.

Why does my API return a 13-digit timestamp?

It is in milliseconds, the unit JavaScript and many logging systems use. Divide by 1000 for seconds-based APIs, or pass it directly to new Date(). If a 13-digit value is treated as seconds, it lands tens of thousands of years in the future.

Should I store timestamps as numbers or ISO strings?

Either works if the value is UTC. Epoch numbers are compact, sort naturally and avoid parsing rules; ISO 8601 strings are readable in logs and queries. The dangerous option is a local date string with no offset, because every service will interpret it differently.