Timestamp Converter

The Complete Timestamp Converter Guide

What Unix time actually is, how seconds differ from milliseconds, why timezones trip people up, and the pitfalls to watch for when converting epoch time.

Open Timestamp Converter

What Is Epoch Time?

Unix time (also called epoch time or POSIX time) counts the number of seconds that have passed since midnight UTC on January 1, 1970 - an arbitrary reference point chosen when Unix was first developed. Every subsequent instant in time is simply the number of seconds elapsed since that moment, with times before 1970 represented as negative numbers.

Because it's a single, timezone-independent number, epoch time is the de facto standard for storing timestamps in databases, log files, and APIs. Two systems in different timezones can agree on exactly when an event happened just by comparing the same number - no timezone conversion needed until you actually want to display it to a human.

Seconds vs Milliseconds

The original Unix timestamp is measured in whole seconds, but many modern languages and platforms - JavaScript included - use milliseconds instead for finer precision. A second-based timestamp for a date in 2026 is 10 digits long; the same instant in milliseconds is 13 digits, because it's simply the seconds value multiplied by 1,000.

UnitTypical Digit Count (current era)Used By
Seconds10 digitsUnix time(), most database TIMESTAMP columns, PHP, Python time.time()
Milliseconds13 digitsJavaScript Date.now(), Java System.currentTimeMillis()

This converter auto-detects which unit you've pasted by counting digits, so you don't have to remember which format a given API or log line uses before converting.

Timezones Explained

A raw Unix timestamp has no timezone of its own - it's simply a count of seconds from a fixed point. Timezone only enters the picture when you convert that number into a human-readable date, because "the same instant" is displayed as a different wall-clock time depending on where you are.

UTCThe reference timezone with zero offset - what servers typically log and store internally.
Local TimeThe same instant, adjusted for whatever timezone your browser or operating system is currently set to.

This is why this converter always shows both UTC and your detected local time side by side for every conversion - it removes the guesswork of "is this already my timezone, or do I need to adjust it?"

Common Pitfalls

  • Mixing up seconds and milliseconds. Feeding a seconds-based timestamp into a millisecond-expecting function (or vice versa) produces a date wildly off - usually near 1970 or thousands of years in the future.
  • Forgetting the timezone of a datetime-local input. Browser date/time pickers work in local time by default, so the same picked value converts to a different UTC timestamp depending on where the visitor is.
  • The Year 2038 problem. Systems that store seconds-based timestamps in a signed 32-bit integer will overflow on January 19, 2038. Most modern systems have already moved to 64-bit storage or milliseconds to avoid this.
  • Assuming a timestamp is always positive. Dates before 1970 are represented as negative numbers, which some parsers or spreadsheet tools handle incorrectly.

Frequently Asked Questions

Why do most databases and APIs store timestamps as plain numbers instead of formatted date strings?

A plain number is trivial to sort, compare, and index without parsing a string or worrying about locale-specific date formats. Two systems can agree on exactly when something happened just by comparing the same integer, and storing it as a fixed-width number is also far more compact than a formatted date string - which is why timestamps dominate database schemas, API responses, and log formats.

Why is Unix time measured from January 1, 1970 specifically?

January 1, 1970 has no special technical significance - it was simply a convenient, recent round date chosen by the early Unix developers in the early 1970s when they needed a fixed starting point to count seconds from. Any other reference date would have worked just as well; that one just happened to stick and became the de facto standard.

Why does a browser's datetime-local input assume local time instead of UTC?

The HTML datetime-local input type has no timezone information built into its value by design - it represents a plain wall-clock date and time with no offset attached. That means a browser (and this tool) has no choice but to treat whatever you pick as your machine's current local time when converting it to a timestamp, so the exact same picked value produces a different underlying UTC instant depending on which timezone the visitor is in.

What actually goes wrong if a millisecond timestamp is fed into code expecting seconds?

Millisecond values are about 1,000 times larger than the equivalent seconds value, so code that expects seconds but receives milliseconds computes a date roughly 1,000 times further from January 1, 1970 than intended - usually landing thousands of years in the future. The reverse mistake, seconds fed into millisecond-expecting code, does the opposite and collapses the date to somewhere just after 1970. Either way, a wildly wrong year is the first clue to check which unit is actually being used.

Why do some APIs return timestamps in seconds while others use milliseconds?

There's no universal standard - it comes down to which language or platform a system was originally built on. Systems that trace back to C's time() function, including Unix itself, PostgreSQL, PHP, and Python's time.time(), default to whole seconds, while JavaScript's Date.now() and many newer web APIs use milliseconds for finer precision. Always check a specific API's own documentation rather than assuming.

Will Unix timestamps ever run out of range?

Systems that store seconds-based timestamps as a signed 32-bit integer will overflow on January 19, 2038 - the so-called Year 2038 problem. Modern systems that use 64-bit integers or milliseconds, like JavaScript's Date object, are unaffected for practical purposes.

Open Timestamp Converter