RevealTheme logo

Unix Timestamp Converter

Convert between Unix timestamps and human-readable dates. Updates in real time.

What is a Unix timestamp and why do APIs use them?

A Unix timestamp (also called epoch time or POSIX time) is a single integer representing the number of seconds elapsed since January 1, 1970 at 00:00:00 UTC — a moment known as 'the Unix epoch'. The convention dates back to the early Unix operating system at Bell Labs in the 1970s. Its value over human-readable dates is that it's a single number, timezone-agnostic, easy to compare and arithmetic on, and unambiguous across systems. Every modern database, log file, JWT, OAuth token, and most APIs use Unix timestamps internally. The 'exp' claim in a JWT is a Unix timestamp; the 'created_at' in most APIs is a Unix timestamp or ISO 8601 string derived from one; file modification times on Linux/macOS are stored as Unix timestamps. There are two common variants you must distinguish: seconds (the original Unix convention, used in JWTs, OAuth, Linux file metadata) and milliseconds (used in JavaScript's Date.now(), Java's System.currentTimeMillis(), and many modern APIs). A 10-digit timestamp is seconds; a 13-digit timestamp is milliseconds. This tool handles both — paste either format in either field and we'll auto-detect and convert. The other concept worth knowing: ISO 8601 is the standard human-readable format (2025-12-31T23:59:59Z) — strictly ordered alphabetically and parseable everywhere. When given a choice between storing timestamps as Unix integers or ISO 8601 strings, prefer Unix for performance and ISO 8601 for human readability.

Common use cases

  • Decode the 'exp' or 'iat' claim from a JWT payload to see when it expires.

  • Convert API response timestamps to your local timezone for debugging.

  • Generate timestamps for setting cookie expiry headers.

  • Translate database timestamps (epoch seconds) to ISO 8601 for log parsing.

  • Calculate elapsed time between two events by subtracting their Unix timestamps.

  • Schedule cron jobs using the at-command with explicit Unix timestamps.

Frequently asked questions

Why 1970?
Convention from early Unix systems at Bell Labs. The choice was arbitrary but stuck. The 32-bit signed integer that originally stored it overflows at 2:14:07 UTC on January 19, 2038 — the 'Year 2038 problem'. Modern systems use 64-bit integers, pushing the overflow to year 292,277,026,596, which is far enough in the future to be irrelevant.
Seconds or milliseconds?
Unix timestamps are seconds (10-digit numbers in 2025). JavaScript's Date.now() and Java's System.currentTimeMillis() use milliseconds (13-digit). Always check which the API you're calling expects — a missing or extra factor of 1000 is the #1 timestamp bug in production code.
How do I see this timestamp in my timezone?
Unix timestamps are timezone-agnostic — they represent the same instant everywhere. Display in your local timezone by passing the timestamp to your language's date formatter with the appropriate timezone. In JavaScript: new Date(ts*1000).toLocaleString('en-US', { timeZone: 'America/New_York' }).
What's the difference between Unix time and UTC?
Unix time is a single number; UTC is a representation that includes year, month, day, hour, minute, second. Unix timestamps are always in UTC by convention — there's no such thing as 'Unix time in EST'. The display can be in any timezone, but the underlying number is universal.
How are leap seconds handled?
Unix time ignores leap seconds — it pretends every day has exactly 86,400 seconds. This means Unix time can briefly run backwards or freeze during leap-second insertions. For most applications this is invisible; for high-precision systems (GPS, financial trading), use TAI (International Atomic Time) instead.
Can Unix timestamps be negative?
Yes — they represent dates before 1970. -1000000 = roughly January 12, 1970 going backwards... wait, that's after. -1000000000 ≈ April 1938. Negative timestamps work in most languages but some legacy systems reject them.
What's an ISO 8601 timestamp?
ISO 8601 is the international standard for human-readable date/time formatting: YYYY-MM-DDTHH:MM:SSZ (Z = UTC, or +HH:MM for other offsets). Example: 2025-12-31T23:59:59Z. ISO 8601 strings sort alphabetically into chronological order, making them excellent for log files and database queries.

Related tools