What is a Unix timestamp?
A Unix timestamp (also called epoch time or POSIX time) is the number of seconds that have passed since 00:00:00 UTC on January 1, 1970, the "Unix epoch", not counting leap seconds. Because it is a single number with no time zone, it is the standard way computers store and exchange points in time: in databases, APIs, log files, JWT tokens and file systems.
Seconds vs milliseconds
Unix timestamps usually count seconds and currently have 10 digits (for example 1767225600). JavaScript, Java and many APIs use milliseconds, which have 13 digits. This converter detects which one you pasted from its size. To convert by hand, divide milliseconds by 1,000 to get seconds.
Getting the current timestamp in code
| Language | Code |
|---|---|
| JavaScript | Math.floor(Date.now() / 1000) |
| Python | int(time.time()) |
| PHP | time() |
| Java | Instant.now().getEpochSecond() |
| Go | time.Now().Unix() |
| MySQL | SELECT UNIX_TIMESTAMP(); |
| Linux shell | date +%s |
Converting a timestamp to a date in code
- JavaScript:
new Date(ts * 1000).toISOString() - Python:
datetime.fromtimestamp(ts, tz=timezone.utc) - PHP:
date('c', $ts) - Shell:
date -d @1767225600(GNU) ordate -r 1767225600(macOS)
Time zones
A timestamp always refers to one exact moment in UTC. Only the display changes with time zone, so the converter shows UTC and your local time side by side. When converting a date back to a timestamp, choose whether the date you entered is in your local time or UTC. Getting this wrong is the most common source of off-by-hours bugs.
The Year 2038 problem
Systems that store Unix time as a signed 32-bit integer can only count up to 2,147,483,647, which is reached at 03:14:07 UTC on January 19, 2038. After that the value overflows. Modern systems use 64-bit timestamps, which will not run out for billions of years.
Frequently asked questions
What is the Unix epoch?
January 1, 1970 at 00:00:00 UTC, the moment Unix time counts from. Its timestamp is 0.
Is a Unix timestamp in UTC?
Yes. A Unix timestamp represents a single moment, counted from the epoch in UTC. Converting it to local time only changes how it is displayed.
How do I know if a timestamp is in seconds or milliseconds?
Present-day timestamps in seconds have 10 digits, and in milliseconds they have 13 digits. The converter detects this automatically.
Can Unix timestamps be negative?
Yes. Negative values represent dates before January 1, 1970.
Last updated December 2, 2026.