Sooner or later, everyone who works with computers meets a number like 1700000000 sitting where a date should be. It appears in a log file, in an API response, in a database row someone asks you about. It does not look like a date. It has no day, no month, no year. Yet it records a precise moment, down to the second, and systems everywhere rely on it.

That number is a Unix timestamp. This guide explains what it counts, why software stores time this way instead of as a readable date, and the handful of confusions that make timestamps look stranger than they are. When you need to turn one into a date, the Unix Timestamp Converter on Ovatly does it in both directions.

Contents

  • Quick answer
  • The epoch: the moment everything counts from
  • Why systems store a number instead of a date
  • Where you will meet timestamps
  • Seconds, milliseconds and the digit test
  • One moment, many displays
  • Limitations
  • Common mistakes
  • FAQs
  • Conclusion

Quick answer

A Unix timestamp is a count of seconds since the Unix epoch: midnight at the start of 1 January 1970 in UTC. The timestamp 0 is that moment itself, and every second since has added one to the count. A variant counts milliseconds instead, which is why some timestamps are a thousand times larger. To read one as a date, paste it into the Unix Timestamp Converter: it shows the moment in UTC, in ISO 8601 form and in your local time, with a plain relative description such as "3 days ago".

The epoch: the moment everything counts from

Every counting system needs a zero. For Unix time, zero is the Unix epoch: midnight at the start of 1 January 1970 in UTC. A timestamp counts the seconds (or, in the millisecond variant, the milliseconds) since that moment. The epoch itself is 0, one second later is 1, and the count has been climbing since.

The choice of 1970 is a historical starting line from the early Unix systems, and its arbitrariness is part of the point. The timestamp does not try to describe the moment in human terms. It just measures distance from an agreed origin, the way an odometer measures distance from where the trip started. Everything human about the moment, the weekday, the month, is worked out later, when someone needs to read it.

That separation is why a timestamp can look so unhelpful raw and still be exact. 1700000000 does not resemble Tuesday, 14 November 2023 at 22:13:20 UTC, but it is that moment, completely and unambiguously, once you know the origin and the unit.

Why systems store a number instead of a date

A readable date is a display, and displays are local. "14 November 2023, 22:13" means one moment in London and a different moment in Tokyo, because the same wall-clock reading is a different instant in each zone. A stored date string carries that ambiguity inside it, plus formatting choices: day first or month first, which language, which separator.

A timestamp sidesteps all of that. One number names one moment, the same for every system that reads it, wherever it runs. Sorting is trivial, because bigger numbers are later moments. Comparing two events is a subtraction. The number is compact, unambiguous and identical across machines, and the human formatting is postponed until a person looks at it, rendered in that person's own time zone. That is the trade at the heart of the format: machines get a clean count, and humans get a conversion step when they want to read it.

Where you will meet timestamps

The converter's own description names the everyday habitats: logs, APIs and database rows. A server log records when each request arrived, as a timestamp. An API response includes fields for when a record was created or last changed, usually timestamps or their ISO equivalent. A database row stores when the account signed up, when the order was placed, when the password last changed, as the same kind of count.

In each case the pattern is the same. The system stored the number because it is exact and portable, and your job is to convert it. Once you can read the date, the log line starts telling its story: this happened before that, this error began at 22:13 on a Tuesday.

Seconds, milliseconds and the digit test

The most common confusion is the unit. The classic Unix timestamp counts seconds. Many environments, JavaScript prominently, count milliseconds instead, for finer resolution. A millisecond timestamp is the same count with three more digits of precision, which makes it roughly a thousand times larger.

The two forms are easy to tell apart by length. Current timestamps in seconds have 10 digits. Current timestamps in milliseconds have 13. If your number has 13 digits, it is almost certainly milliseconds. The converter auto-detects the difference using a simple rule: values of 1 trillion or more are treated as milliseconds, and smaller values as seconds, and it shows which unit it used so you can verify the reading. You can also force seconds or milliseconds with the unit selector when you know what you have.

Getting the unit wrong is not a small error. Read a millisecond value as seconds and the date lands tens of thousands of years in the future. Read a seconds value as milliseconds and it collapses to within hours of the epoch in 1970. When a converted date looks absurd, the unit is the first suspect.

One moment, many displays

The second confusion is the hour. Convert a timestamp on two machines in different places and the local readings differ, which looks like a contradiction until you see why. The moment is identical; only its display changes with time zone. UTC and ISO values are zone-free: they pin the moment itself. A local display applies the device's zone on top, so the hour shifts while the instant stays put.

This is the stored-number design working as intended. The timestamp never claimed a wall-clock time; it claimed an instant. Each viewer renders that instant on their own clock, and two different hours for one timestamp are both correct. Compare the UTC line when you need common ground.

Limitations

A timestamp tells you when, and nothing else: it carries no place, no zone and no context, so the reading depends on the frame you apply to it. The millisecond variant hides a detection edge: a millisecond value from before 2001 is smaller than 1 trillion, so length-based auto-detection could misread it as seconds, which is why the converter lets you force the unit. And the count is not infinite in practice: values beyond the range JavaScript dates support, about 275,000 years either way, are reported as errors rather than rendered as dates.

Common mistakes

  • Reading a 13-digit value as seconds. Count the digits first. Ten is seconds, thirteen is milliseconds, and confusing them is the single most common timestamp error.
  • Arguing over the hour. Two local displays of one timestamp can differ by many hours and both be right. Compare UTC readings when you need common ground.
  • Assuming a timestamp includes a time zone. It does not. The zone enters only when the moment is displayed, which is exactly why the stored value travels so well.
  • Trusting an absurd result. A date in the far future or in January 1970 is the format telling you the unit or the value is wrong. Check the digits before you believe it.

FAQs

What is the Unix epoch? Midnight at the start of 1 January 1970 in UTC. A Unix timestamp counts the seconds (or milliseconds) since that moment, so the timestamp for the epoch itself is 0 and every later moment is a larger positive number.

Is a timestamp in seconds or milliseconds? Both forms exist. Current timestamps in seconds have 10 digits; in milliseconds they have 13. If your number has 13 digits it is almost certainly milliseconds. A converter can auto-detect the difference and show which unit it used.

Why does the same timestamp show a different hour for me? The moment is identical; only its display changes with time zone. UTC and ISO values are zone-free, while a local display applies your device's zone, so two people in different places see different hours for the same stored timestamp, and both are right.

Where do timestamps appear in practice? In logs, APIs and database rows, among other places: anywhere a system records when something happened. Converting one into a readable date is usually the first step to understanding a log line or a stored record.

How large can a timestamp get? A long way, but not forever. The converter reports values beyond the range JavaScript dates support, about 275,000 years either way, as errors. Real timestamps sit nowhere near that range, so an error is a good sign the value was not a timestamp to begin with.

Conclusion

A Unix timestamp is a simple idea wearing an unfriendly disguise: seconds counted from a fixed midnight in 1970, stored as one number so that every system reads the same moment. Know the epoch, count the digits for the unit, and remember the zone belongs to the display, not the value, and the disguise falls away. For the practical side, the step-by-step guide How to Convert a Unix Timestamp to a Date walks through real conversions, and the Developer Tools archive collects the other formats and encodings you will meet alongside timestamps.