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 (what UTC itself is, and how zones hang off it, is in UTC and time zones explained). 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 | floor(extract(epoch from now()))::bigint | floor(extract(epoch from now()) * 1000)::bigint |
| Shell (GNU date) | 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. For a job that repeats on a schedule, the cron expression builder lists its next run times in UTC or your own time zone.
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.
Guides on this topic
- UTC and Time Zones Explained: Offsets, GMT, Leap Seconds
- ISO 8601 Date Format Explained: T, Z, Offsets and Sorting
- The Year 2038 Problem: When 32-Bit Time Runs Out
- Date Formats Around the World: DD/MM, MM/DD and YYYY-MM-DD
- Leap Seconds Explained: UTC, TAI and Their End
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.