What Unix time is
A Unix timestamp is the number of seconds elapsed since 00:00:00 UTC on 1 January 1970 — the "Unix epoch". It is a single integer with no timezone, no calendar and no formatting, which is exactly why databases, logs and APIs use it: one number that means the same instant everywhere on earth.
The trade-off is that it is unreadable to people, which is what this converter is for. Negative values represent instants before 1970 and are handled correctly by the timestamp-to-date direction.
Seconds or milliseconds — check the digit count
This is the single most common source of wrong answers, and it is worth being deliberate about.
Unix time is conventionally counted in seconds, which gives a 10-digit number for any current date. JavaScript's Date.now(), Java's System.currentTimeMillis() and many JSON APIs use milliseconds, which gives 13 digits.
Count the digits before you convert. Ten means seconds; thirteen means milliseconds. This tool does not auto-detect, so a 13-digit value left on the seconds setting is multiplied by a thousand again and lands tens of thousands of years in the future — with no warning, because that is still a technically valid date.
Recognising the unit from the number
| Digits |
Unit |
Where it comes from |
| 10 |
Seconds |
PHP time(), Python time.time(), Unix date +%s, most SQL and most APIs |
| 13 |
Milliseconds |
JavaScript Date.now(), Java currentTimeMillis(), many JSON payloads |
| 16 |
Microseconds |
Some high-resolution logs — divide by 1,000 to use here |
| 19 |
Nanoseconds |
Go UnixNano(), some tracing systems — divide by 1,000,000 |
Local time, UTC and ISO 8601
The same instant reads differently depending on how you write it, and the three outputs answer three different questions.
- Local Time — the instant as it appears on the machine you are using now, in its timezone and locale format. Useful for "when did this happen for me", but it moves if you open the same timestamp on a machine set to another timezone.
- UTC — the same instant on the global reference clock, with no daylight-saving. This is what to quote when you are talking to someone in another country.
- ISO 8601 — the machine-readable form, always in UTC and always ending in Z (for example 2026-09-05T14:30:00.000Z). This is the format to put in an API payload, a config file or a log.
- Relative — "3 hours ago". Good for a quick sense of recency; not something to paste into a record.
Getting the current timestamp in code
The live figure at the top of the page is handy for a quick check, but you will usually want it from the language you are working in.
Current Unix timestamp by language
| Language |
Seconds |
Milliseconds |
| JavaScript |
Math.floor(Date.now() / 1000) |
Date.now() |
| PHP |
time() |
(int) (microtime(true) * 1000) |
| Python |
int(time.time()) |
int(time.time() * 1000) |
| Shell |
date +%s |
date +%s%3N (GNU date) |
| MySQL |
UNIX_TIMESTAMP() |
— |
| PostgreSQL |
EXTRACT(EPOCH FROM NOW()) |
— |
The year 2038 problem
Systems that store Unix time in a signed 32-bit integer run out of room at 03:14:07 UTC on 19 January 2038, at timestamp 2147483647. One second later the value overflows to a negative number, which reads as December 1901.
Modern 64-bit systems are unaffected, but the constraint persists in embedded devices, older database columns and file formats. If you are designing storage now, use a 64-bit integer or a native timestamp type.