Epoch Time Converter

Convert Unix timestamps to human-readable dates and back. The live timestamp updates every second.

Timestamp → Date

Seconds, milliseconds, microseconds or nanoseconds, detected by length. Negative values work too.

Date → Timestamp

YYYY-MM-DD or YYYY-MM-DD HH:MM:SS. Add Z or an offset like +05:30; without one it is read as UTC.

Notable Unix Timestamps

Useful reference points. Paste any of these into the converter above.

Unix TimestampUTC Date & TimeNote
-86400Dec 31, 1969 00:00:00 UTCOne day before the epoch
0Jan 1, 1970 00:00:00 UTCUnix epoch, time zero
1000000000Sep 9, 2001 01:46:40 UTCOne billion seconds
1234567890Feb 13, 2009 23:31:30 UTCThe 1234567890 milestone
1500000000Jul 14, 2017 02:40:00 UTC1.5 billion seconds
1700000000Nov 14, 2023 22:13:20 UTC1.7 billion seconds
2000000000May 18, 2033 03:33:20 UTC2 billion seconds
2147483647Jan 19, 2038 03:14:07 UTCYear 2038 limit for 32-bit systems

What Is Epoch Time?

Epoch time, also called Unix time or a Unix timestamp, is a single integer that counts the seconds elapsed since January 1, 1970 at 00:00:00 UTC. It carries no time zone and no daylight saving rules, so one number identifies one instant.

A server in Tokyo and a server in New York that log the same event at the same instant record the same integer. The live value at the top of this page is the current count. One caveat: Unix time treats every day as exactly 86,400 seconds, so it skips over leap seconds instead of counting them. For almost all software that makes no practical difference.

That is why databases, log files and APIs usually store a Unix timestamp (or an ISO 8601 date in UTC) and only format it into a local, human-readable date for display. See what Unix time is for the short definition.

📊 Unix timestamps are defined by POSIX and are the native time representation on Linux, macOS and other Unix-like systems. W3Techs reports that Unix-family systems run over 90% of the websites whose server operating system it can identify (W3Techs, operating system usage).

Why Does Unix Time Start on January 1, 1970?

The short answer is that it was a practical choice. The first edition of the Unix Programmer's Manual (1971) counted time in sixtieths of a second since January 1, 1971, and a 32-bit counter of that size only lasted about 2.5 years. Unix was later changed to count whole seconds, and the epoch was set at the start of 1970. Dennis Ritchie is quoted as saying they wanted something that would not overflow for a while and that 1970 seemed as good as any.

There is nothing mathematically special about the date. Other systems chose other starting points: NTP counts from January 1, 1900, and classic Mac OS counted from January 1, 1904. Unix's 1970 epoch spread with Unix, C, and the languages built on top of them, which is why JavaScript, Python, and most databases use it today.

One practical consequence is that negative timestamps are valid and represent dates before 1970. -86400 is December 31, 1969, and this converter accepts negative values. Most modern 64-bit systems handle them correctly too.

Seconds vs Milliseconds: Which Are You Looking At?

Unix timestamps traditionally count seconds. A 10-digit number like 1717372800 is seconds. JavaScript's Date.now() returns milliseconds, a 13-digit number like 1717372800000.

The rule of thumb is that 10 digits means seconds and 13 digits means milliseconds. This converter guesses the unit from the length of the number: up to 11 digits is read as seconds, 12 to 14 as milliseconds, 15 to 17 as microseconds, and 18 or more as nanoseconds. The result shows which unit it used, so you can spot a wrong guess. The only ambiguity is for dates before 1973 written in milliseconds, which are short enough to be read as seconds.

FormatDigitsExampleUsed In
Unix (seconds)101717372800Most Unix tools, many databases and APIs
Unix (milliseconds)131717372800000JavaScript, Java
Unix (microseconds)161717372800000000Some databases and logging systems
Unix (nanoseconds)191717372800000000000Go (UnixNano), high-precision logs

How to Get the Current Epoch Time in Code

JavaScript / Node.js
Math.floor(Date.now() / 1000)   // seconds
Date.now()                       // milliseconds
Python
import time
int(time.time())                 # seconds
time.time_ns() // 1_000_000      # milliseconds
PHP
time()                           // seconds
round(microtime(true) * 1000)    // milliseconds
Go
time.Now().Unix()                // seconds
time.Now().UnixMilli()           // milliseconds
SQL (MySQL / PostgreSQL)
UNIX_TIMESTAMP()                 -- MySQL
EXTRACT(EPOCH FROM NOW())        -- PostgreSQL

The Year 2038 Problem

On January 19, 2038 at 03:14:07 UTC, a signed 32-bit Unix timestamp reaches its maximum value of 2,147,483,647. One second later it overflows to −2,147,483,648, which a system that does not handle it will read as December 13, 1901.

Systems that use a 64-bit time value are not affected; a signed 64-bit count of seconds lasts roughly 292 billion years. The risk sits in legacy embedded systems, old firmware, and any software or file format that still stores time in 32 bits. Migration has been under way for years, but such systems can stay in service for a long time.

The timestamp 2147483647 is the last safe second for 32-bit systems.

Frequently Asked Questions

What is a Unix timestamp?

A Unix timestamp is an integer counting the seconds since January 1, 1970 at 00:00:00 UTC. It has no time zone or daylight saving offset, so it identifies one instant that every system can convert into its own local time.

What is epoch time?

Epoch time and Unix time are the same thing: the count of seconds since the Unix epoch, January 1, 1970 UTC. "Epoch" just means the fixed reference point that time is measured from.

How do I convert a Unix timestamp to a date?

Paste it into the converter above. In code, use new Date(timestamp * 1000) in JavaScript for a seconds value, or datetime.fromtimestamp(ts, tz=timezone.utc) in Python. Without the tz argument, Python returns your local time.

What is timestamp 0 in Unix time?

Timestamp 0 is January 1, 1970 at 00:00:00 UTC, the Unix epoch itself.

What is the difference between a 10-digit and 13-digit timestamp?

A 10-digit timestamp counts seconds and a 13-digit one counts milliseconds, like JavaScript's Date.now(). Multiply seconds by 1000 to get milliseconds, or divide milliseconds by 1000 to get seconds. This converter detects the unit from the length of the number and tells you which it used.

What is the Year 2038 Problem?

A signed 32-bit timestamp tops out at 2,147,483,647, which is January 19, 2038 at 03:14:07 UTC. One second later it overflows to a negative number, which unpatched systems read as December 13, 1901. Systems using 64-bit time are unaffected.

Can Unix timestamps be negative?

Yes. Negative timestamps are dates before January 1, 1970: -86400 is December 31, 1969 at 00:00:00 UTC. This converter accepts them.

What time zone does the date-to-timestamp converter use?

UTC, unless you add an offset. 2024-06-03 14:30:00 is read as UTC, while 2024-06-03T20:00:00+05:30 is converted using the offset you gave. Both give 1717425000, because they are the same instant.

How do I get the current Unix timestamp in JavaScript?

Use Math.floor(Date.now() / 1000) for seconds, or Date.now() for milliseconds.

Related Tools