Skip to content

Unix timestamp converter — epoch to date and back

Convert Unix epoch timestamps to human dates and back, with automatic seconds/milliseconds detection, ISO 8601, RFC 2822 and a batch mode.

  • Runs in your browser
  • Nothing you enter is sent
  • Free, no account
Current Unix time
—
starting clock…
Convert a timestamp
Paste an epoch value in seconds, milliseconds, microseconds or nanoseconds.

Loading timezone list…

What a Unix timestamp is

A Unix timestamp — also called epoch time or POSIX time — is the number of seconds that have elapsed since 1 January 1970 at 00:00:00 UTC, not counting leap seconds. It is a single integer with no timezone, no calendar and no formatting, which is exactly why databases, log files, JWTs, HTTP caches and APIs use it. Two systems on opposite sides of the world agree on the value with no negotiation.

Negative values are legal and mean "before 1970": −86400 is 31 December 1969. Fractional values are common in Python and JavaScript, where sub-second precision is carried in the decimal part or in a larger unit.

Seconds, milliseconds, microseconds and nanoseconds

The same instant can be written with different precision, and the only reliable clue is how many digits it has. That is what the automatic detection uses:

Digits Unit Example Typical source
10 Seconds 1755345600 Unix tools, PHP, Go, Ruby, JWT exp and iat claims
13 Milliseconds 1755345600000 JavaScript Date.now, Java, Kafka, MongoDB
16 Microseconds 1755345600000000 Postgres internal timestamps, Chrome traces
19 Nanoseconds 1755345600000000000 Go time.UnixNano, Prometheus, InfluxDB

Detection is a heuristic, not a proof: a 10-digit value could in principle be milliseconds from 1970. If a converted date looks absurd — 1970 when you expected last week, or the year 55000 — set the unit manually rather than trusting the guess.

The output formats explained

  • ISO 8601 — the interchange standard, e.g. 2026-08-16T14:05:07+02:00. Sorts correctly as plain text, which is why it belongs in filenames and log lines. The Z suffix means an offset of zero.
  • RFC 2822 / HTTP date — the email and HTTP header format, e.g. Sat, 16 Aug 2026 12:05:07 GMT. Always expressed in UTC in this tool, which is what the HTTP specification requires.
  • Relative time — "3 days ago", "in 4 hours". Rendered with your browser's own locale rules, so it reads naturally in your language.
  • Local time — the same instant in whichever IANA timezone you pick, with the correct daylight-saving offset for that date.

Timestamps have no timezone

This trips up a lot of debugging sessions. The number 1755345600 does not "mean" 14:00 in Berlin or 08:00 in New York — it means one specific instant, and those are two renderings of it. If a stored timestamp appears to be several hours off, the bug is nearly always in the formatting layer or in a naive local-time parse on the way in, not in the timestamp itself.

The year 2038 problem

A signed 32-bit integer counting seconds runs out on 19 January 2038 at 03:14:07 UTC, after which it wraps to December 1901. Modern systems use 64-bit time, and JavaScript numbers safely represent milliseconds up to the year 275760, so values past 2038 convert correctly here. Embedded firmware, old filesystems and legacy C code are where the problem still lives.

Leap seconds

Unix time deliberately ignores leap seconds: every day is defined as exactly 86,400 seconds. During a leap second the same Unix value is used twice, or the clock is smeared over several hours. This means a Unix timestamp is not a true count of SI seconds since 1970 — it is off by the number of leap seconds inserted since then — but it does mean the arithmetic is simple and matches what your database reports.

Getting the current timestamp elsewhere

Language or tool Seconds Milliseconds
Shell date +%s date +%s%3N
JavaScript Math.floor(Date.now() / 1000) Date.now()
Python int(time.time()) int(time.time() * 1000)
PostgreSQL SELECT extract(epoch FROM now())::bigint multiply by 1000
MySQL SELECT UNIX_TIMESTAMP() SELECT UNIX_TIMESTAMP(NOW(3)) * 1000
Go time.Now().Unix() time.Now().UnixMilli()

Batch mode

Paste a column straight out of a log file, a CSV or a query result — one value per line, or comma separated. Up to 2,000 values are converted at once, each with its detected unit, and the whole table can be copied or downloaded as CSV. Values that cannot be read are flagged individually rather than failing the whole batch.

Questions

How does it tell seconds from milliseconds?

By magnitude. Values up to about 10 digits are read as seconds, 13-digit values as milliseconds, and 16 or 19 digits as microseconds or nanoseconds. You can always override the unit manually.

What is the year 2038 problem?

A signed 32-bit counter of seconds overflows on 19 January 2038 at 03:14:07 UTC. This converter uses JavaScript numbers, which handle timestamps well beyond that, so 2038 values convert fine here.

Are Unix timestamps timezone dependent?

No — an epoch value is always seconds since 1970-01-01 00:00:00 UTC. Only the human-readable rendering depends on a timezone, which is why the display zone is shown and selectable.

Can I convert a whole list at once?

Yes. Batch mode accepts one timestamp per line, or comma-separated values, and returns a table you can copy or download as CSV.

Do leap seconds affect the result?

No. Unix time deliberately ignores leap seconds — every day is exactly 86,400 seconds long — so conversions here match what servers and databases report.