EsyTool
Developer Tools

Unix Timestamp Explained: Converting Epoch Time to Human-Readable Dates

That mysterious 10 or 13-digit number in API responses and log files is a Unix timestamp. Here's what it means, why it starts in 1970, and the seconds-vs-milliseconds trap.

July 10, 20263 min read
Convert Unix timestamps to readable dates instantly

You've seen it in an API response, a log file, or a database column: a number like 1719849600, with no obvious connection to a date. That's a Unix timestamp — the number of seconds that have elapsed since January 1, 1970, 00:00:00 UTC, a moment known as the Unix epoch.

Why 1970?

The epoch date isn't meaningful in itself — it was chosen somewhat arbitrarily during early Unix development as a convenient recent reference point. What matters is that it gave every system a single, unambiguous, timezone-independent reference for representing a point in time as a plain integer, rather than a formatted string that varies by locale and calendar system.

The seconds-vs-milliseconds trap

This is the single most common bug when working with timestamps across languages. Unix time is traditionally measured in seconds (a 10-digit number for current dates), but JavaScript's Date object and many web APIs use milliseconds (a 13-digit number) since epoch instead. Mixing the two up produces either a date in 1970 (if you treat milliseconds as seconds, the number is 1000x too small) or a date thousands of years in the future (if you treat seconds as milliseconds).

  • 10 digits (e.g. 1719849600) → seconds since epoch — the traditional Unix standard, used by most backend languages and APIs
  • 13 digits (e.g. 1719849600000) → milliseconds since epoch — what JavaScript's Date.now() and new Date().getTime() return

If a date you're converting comes out wildly wrong, check the digit count first — it's almost always this mismatch, not a logic bug.

Why store timestamps as integers instead of formatted dates

  • Timezone-independent — the number itself doesn't change based on where it's read; formatting to a human-readable date is a display-time concern, not a storage concern
  • Trivial to compare and sort — comparing two integers is simpler and less error-prone than comparing formatted date strings
  • Compact and unambiguous — no locale-dependent parsing ambiguity like whether 03/04/2026 means March 4th or April 3rd

The standard practice is to store and transmit timestamps as Unix time, then convert to a human-readable, timezone-adjusted format only at the point where a person actually reads it — in the UI, a log viewer, or a report.

Try Timestamp Converter now

Free, runs entirely in your browser — no upload, no sign-up.

Open Timestamp Converter