What is a Unix Timestamp?
A Unix timestamp (also called epoch time or POSIX time) is the number of seconds that have elapsed since 00:00:00 UTC on January 1, 1970 — the "Unix epoch" — not counting leap seconds. It is the universal way computers store a moment in time as a single number, independent of time zones. This calculator converts a value in milliseconds into the standard Unix timestamp in seconds, and also shows the equivalent minutes, hours, and days since the epoch.
How to Use It
Enter a time value in milliseconds. To get the current Unix timestamp ("epoch now"), supply the present time in milliseconds; the default value is provided as an example. The calculator divides by 1,000 and rounds down to give whole seconds, the format expected by almost every API, database, and programming language.
The Formula Explained
The core conversion is $$\text{Epoch} = \left\lfloor \dfrac{\text{Time (ms)}}{1000} \right\rfloor$$ Milliseconds offer thousandth-of-a-second precision, but the classic Unix timestamp is measured in whole seconds, so we take the floor (drop the fractional part). From there, dividing the epoch by 60, 3,600, and 86,400 yields minutes, hours, and days respectively.
$$\begin{aligned} \text{Minutes} &= \left\lfloor \tfrac{\text{Epoch}}{60} \right\rfloor \\ \text{Hours} &= \left\lfloor \tfrac{\text{Epoch}}{3600} \right\rfloor \\ \text{Days} &= \left\lfloor \tfrac{\text{Epoch}}{86400} \right\rfloor \end{aligned}$$
Worked Example
Suppose the current time is 1,700,000,000,000 milliseconds. Dividing by 1,000 gives 1,700,000,000 seconds — that is the Unix timestamp.
$$\left\lfloor \frac{1{,}700{,}000{,}000{,}000}{1000} \right\rfloor = 1{,}700{,}000{,}000 \text{ s}$$Dividing 1,700,000,000 by 86,400 and flooring gives 19,675 days since January 1, 1970, which corresponds to mid-November 2023.
$$\left\lfloor \frac{1{,}700{,}000{,}000}{86{,}400} \right\rfloor = 19{,}675 \text{ days}$$FAQ
Why seconds and not milliseconds? The original Unix standard uses seconds. JavaScript's Date.now() returns milliseconds, so you often divide by 1,000.
Does it handle time zones? No — Unix time is always UTC. The same instant has the same timestamp everywhere on Earth.
What is the year 2038 problem? Systems storing the timestamp in a signed 32-bit integer overflow on January 19, 2038. Modern 64-bit systems avoid this.