Epoch time in plain words
Computers store moments in time as a single number: the seconds that have passed since the Unix epoch, midnight UTC on January 1, 1970. A timestamp of 1,800,000,000 is January 15, 2027 at 08:00 UTC, the same moment in Tokyo, London and New York. Many systems, including JavaScript and Java, count milliseconds instead, which gives 13 digits.
Getting the current timestamp in code
| Language | Seconds | Milliseconds |
|---|---|---|
| JavaScript | Math.floor(Date.now() / 1000) | Date.now() |
| Python | int(time.time()) | time.time_ns() // 1_000_000 |
| PHP | time() | (int) (microtime(true) * 1000) |
| Java | Instant.now().getEpochSecond() | System.currentTimeMillis() |
| MySQL | UNIX_TIMESTAMP() | ROUND(UNIX_TIMESTAMP(NOW(3)) * 1000) |
| PostgreSQL | extract(epoch from now())::bigint | (extract(epoch from now()) * 1000)::bigint |
| Shell | date +%s | date +%s%3N |
ISO 8601 and time zones
When a person needs to read a time, use ISO 8601 with an offset, like 2027-01-15T09:00:00+01:00, or the UTC form ending in Z. When a program stores it, a Unix timestamp is shorter and cannot be misread. Converting a local date to a timestamp needs its time zone, including daylight saving time, which this converter applies for the exact date you enter.
How to use the timestamp converter
- 1Paste a timestamp on the left. The unit is detected from the number of digits, or pick it yourself.
- 2Read the date in UTC, your local time, ISO 8601 and how long ago it was.
- 3To go the other way, enter a date, time and time zone on the right and copy the timestamp.
Frequently asked questions
What is a Unix timestamp?
A Unix timestamp, also called epoch time, counts the seconds since January 1, 1970 at 00:00:00 UTC. It is the same number everywhere in the world at the same moment, which makes it the standard way to store and compare times in databases, logs and APIs.
Is my timestamp in seconds or milliseconds?
Count the digits. Today a timestamp in seconds has 10 digits, in milliseconds 13, in microseconds 16 and in nanoseconds 19. The converter detects this automatically; you can also pick the unit yourself.
Do Unix timestamps have time zones?
No. A timestamp always means one exact moment in UTC. Time zones only matter when you show it as a date and time for people, or when you turn a local date into a timestamp. That is why the converter asks for the time zone of the date you enter.
What is the year 2038 problem?
Older systems store Unix time as a signed 32-bit number, which runs out on January 19, 2038 at 03:14:07 UTC. Modern systems use 64-bit numbers that last for billions of years, but old embedded devices and file formats may still be affected.
Does it handle leap seconds?
Unix time ignores leap seconds: every day has exactly 86,400 seconds. That matches how computers, databases and programming languages treat time, so the results here agree with your code.