Unix Timestamp to Date: How to Tell Seconds from Milliseconds Before You Convert

person فريق سهلcalendar_today October 14, 2026schedule 5 min read
A numeric timestamp turning into a readable date and time

You open a table in your database and find a column called created_at holding 1736035200. That value tells you nothing at a glance. It is a date, certainly, but which day, and in which time zone? Then another table shows 1736035200000, which looks like the same number with three extra zeros. Are they the same moment? That is exactly what a timestamp converter is for.

What a Unix timestamp is

It is a way of representing a moment in time as a single number: the count of seconds that have passed since midnight on the first of January 1970, in Coordinated Universal Time (UTC). That moment is called the epoch. Zero, for instance, is that very instant.

The approach spread because it leaves no room for ambiguity: one number that depends on no language, no time zone and no date-writing convention. Day first or month first? A question that does not exist when the date is a number. It is easy to add, subtract and compare too, since one day is exactly 86,400 seconds.

The real problem: the unit

A simple story gets complicated the moment a system uses a different unit. The three common ones:

  • Seconds: ten digits at the present time. Used by Unix systems and many databases.
  • Milliseconds: thirteen digits. The default in JavaScript and in most modern APIs.
  • Microseconds: sixteen digits, found in fine-grained performance logs.

The two numbers at the top of this article are the same instant in two units. Feed the second to a tool that treats it as seconds and you get a date in a year far beyond our lifetimes, thousands of years from now. Do the reverse and you get a date in January 1970, as though the number were tiny. The error is always a factor of a thousand, with no warning of any kind.

Sahel's timestamp converter recognises the unit from the length of the number, but it never applies its choice silently. It shows you plainly which unit it assumed, so you can confirm at a glance and switch manually if the number is unusual.

How to use it

  1. Paste the number into the tool, or choose the reverse direction to turn a date into a number.
  2. Check the detected unit shown beside the result.
  3. Read the date in UTC and in your device's local time.
  4. Copy the format you need.

Time zones: why you see two different clocks

The timestamp itself carries no time zone. It is one moment, worldwide. What differs is how it is displayed: nine in the morning in Riyadh is two in the morning in London in winter, and it is the same instant with the same number. So the tool shows UTC beside your device's time, to save you from the common mistake of comparing a server's UTC clock against your phone's local clock and concluding they disagree.

A useful rule in programming: always store time as a number or in UTC, and convert to local time only at the moment you display it to a user.

Common mistakes with timestamps

  • Storing the date as text: writing it as "05/01/2025" invites confusion between day and month and makes sorting and comparison harder. A number is clearer and simpler.
  • Mixing units within one system: one table stores seconds, another milliseconds, and then a query joins them. Put the unit in the column name, such as created_at_ms, so it is not forgotten.
  • Trusting the user's device clock: a phone's clock may simply be set wrong. The time that matters should come from the server.
  • Counting days by multiplying by 86,400 alone: fine for raw time differences, but no good for "the same day next month", because months vary in length. For that, the date difference calculator is the right tool.

A realistic scenario

A developer is investigating a customer report that a subscription ended early. Opening the record she finds an expires_at field with a thirteen-digit value. She pastes it into the tool and discovers the unit is milliseconds, and the resulting date is exactly the right expiry. So the field was never wrong; an export file was reading it as seconds and displaying a bad date. She found the cause in seconds because the tool made the unit explicit rather than guessing it. And if she is reading a token with time fields in it, the JWT decoder converts the issue and expiry claims automatically.

Frequently asked questions

Is a timestamp affected by daylight saving time?

No. It is a steady counter that knows nothing about daylight saving. Any change happens only when it is converted to a local date for display.

What is the year 2038 problem?

Systems that store seconds in a thirty-two-bit signed integer reach its maximum in January 2038, after which the value wraps around to a negative number. Modern systems use wider numbers and are unaffected, but older embedded systems may not be.

Can a timestamp be negative?

Yes, and it represents a moment before 1970. Negative values are valid and the tool converts them to a date as normal.

Why does the number differ slightly between two servers?

Because each machine's clock drifts a little from true time unless it is regularly synchronised with an accurate source. A second or two of difference between machines is normal; a difference of hours points to a configuration fault.

Is the number I enter sent to a server?

No. The conversion happens entirely in your browser and nothing is transmitted.

Related articles