Unix Timestamp Converter
Convert a Unix timestamp (seconds or milliseconds) to a date and time in any time zone, or a date back to a timestamp. Everything runs in your browser.
Enter a timestamp or a date above and press Convert.
What is a Unix timestamp?
A Unix timestamp (also called epoch time or POSIX time) is the number of seconds that have passed since 1 January 1970, 00:00:00 UTC, a moment known as the Unix epoch. For example, 1767225600 is exactly 2026-01-01 00:00:00 UTC.
A timestamp has no time zone. The same number means the same moment everywhere in the world; only the way you display it changes. That is why databases, APIs and log files like to store time as a timestamp, and why this converter asks for a time zone only to show the date.
Seconds or milliseconds? Count the digits
Different systems count in different units. For dates between 2001 and 2286, the number of digits tells you the unit:
| Digits | Unit | 2026-01-01 00:00 UTC | Used by |
|---|---|---|---|
| 10 | seconds | 1767225600 | Unix, PHP time(), Python time.time(), MySQL UNIX_TIMESTAMP(), JWT exp |
| 13 | milliseconds | 1767225600000 | JavaScript Date.now(), Java System.currentTimeMillis(), many JSON APIs |
| 16 | microseconds | 1767225600000000 | PostgreSQL internals, Python time.time_ns() // 1000 |
| 19 | nanoseconds | 1767225600000000000 | Go UnixNano(), InfluxDB, Linux kernel |
This converter reads the digit count, picks the unit for you, and tells you which unit it used.
Get 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 |
| Java | Instant.now().getEpochSecond() | System.currentTimeMillis() |
| Go | time.Now().Unix() | time.Now().UnixMilli() |
| PHP | time() | (int) (microtime(true) * 1000) |
| C# | DateTimeOffset.UtcNow.ToUnixTimeSeconds() | DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() |
| MySQL | SELECT UNIX_TIMESTAMP(); | SELECT ROUND(UNIX_TIMESTAMP(NOW(3)) * 1000); |
| PostgreSQL | SELECT extract(epoch FROM now())::bigint; | SELECT (extract(epoch FROM now()) * 1000)::bigint; |
| Bash (Linux) | date +%s | date +%s%3N |
Time zones and daylight saving time
Use an IANA time zone name such as Europe/London or America/New_York, not an abbreviation like EST or CST. A name knows the rules of that place, including daylight saving time, so 12:00 in New York gives the right timestamp in both January (UTC−5) and July (UTC−4). Abbreviations are ambiguous: CST can mean US Central, China or Cuba Standard Time.
On the day the clocks move forward, some local times do not exist (for example 02:30 in New York on the second Sunday of March). On the day the clocks move back, one hour happens twice. This converter follows the rules most software uses: a missing time moves forward by one hour, and a repeated time uses the earlier moment.
Frequently asked questions
What is epoch time?
Epoch time is another name for Unix time: the number of seconds since 1 January 1970, 00:00:00 UTC. "The epoch" is that starting moment. Some systems count milliseconds from the same moment instead of seconds.
Is a Unix timestamp in UTC or in local time?
Neither, strictly speaking: it is a count of seconds and has no time zone. It starts from a UTC moment, so converting it to UTC always gives the same result everywhere. You choose a time zone only when you want to show it as a local date and time.
Why does my timestamp convert to a date in 1970?
You probably read a timestamp in seconds as if it were milliseconds. For example, 1767225600 read as milliseconds is 21 January 1970. This converter checks the number of digits, so a 10-digit value is read as seconds.
How do I convert a Unix timestamp to a date in Excel or Google Sheets?
For seconds in cell A1, use =A1/86400+DATE(1970,1,1). For milliseconds, use =A1/86400000+DATE(1970,1,1). Then format the cell as a date and time. The result is in UTC; to show UTC+8, for example, add 8/24.
What is the year 2038 problem?
Old systems store Unix time as a signed 32-bit number. The largest value, 2147483647, is 2038-01-19 03:14:07 UTC. One second later the number overflows, and those systems jump back to 1901. Modern systems use 64-bit numbers, which last for billions of years.
Can a Unix timestamp be negative?
Yes. A negative timestamp is a moment before 1970. For example, -86400 is 31 December 1969, 00:00:00 UTC. This converter accepts negative values.
Does Unix time count leap seconds?
No. Unix time treats every day as exactly 86,400 seconds and ignores leap seconds. For almost all software this does not matter.