Unix Timestamp Converter

See the current Unix time live, convert any epoch timestamp to a readable date in any time zone, or turn a date and time into a timestamp. Seconds, milliseconds, microseconds and nanoseconds are detected automatically.

Current Unix time (seconds)0
Milliseconds0
UTC (ISO 8601)

Your browser’s time zone:

Timestamp → date

Date → timestamp

ISO 8601 / date string → timestamp

What is a Unix timestamp?

A Unix timestamp, also called epoch time or POSIX time, is the number of seconds that have elapsed since 00:00:00 UTC on 1 January 1970, a moment known as the Unix epoch. For example, 1700000000 is 14 November 2023 at 22:13:20 UTC. Because it is a single number that means the same instant everywhere on Earth, it is the standard way computers store and exchange points in time: in databases, log files, JWT tokens, file systems and most programming languages.

Timestamps have no time zone. The same value is displayed as different wall-clock times in New York and Tokyo, but it always refers to the same moment. Time zones only come into play when converting to or from a human-readable date, which is exactly what this tool does.

How to use the converter

Seconds, milliseconds, microseconds or nanoseconds?

Different systems count epoch time with different precision, and mixing them up is a common source of dates in 1970 or in the year 55,000. Auto-detection uses the number of digits, which works for any date between roughly 1973 and 5138:

Digits (current dates)UnitTypical sources
10SecondsUnix/Linux date +%s, PHP time(), Python int(time.time()), most SQL databases, JWT exp claims
13MillisecondsJavaScript Date.now(), Java System.currentTimeMillis(), many JSON APIs
16MicrosecondsPostgreSQL internals, Python time.time_ns() // 1000, some tracing tools
19NanosecondsGo time.Now().UnixNano(), InfluxDB, Prometheus remote storage

If you are converting dates close to 1970, such as small test values, choose the unit manually, because a short number is always treated as seconds.

Getting the current timestamp in code

JavaScript   Math.floor(Date.now() / 1000)
Python       import time; int(time.time())
PHP          time()
Java         Instant.now().getEpochSecond()
C#           DateTimeOffset.UtcNow.ToUnixTimeSeconds()
Go           time.Now().Unix()
Ruby         Time.now.to_i
MySQL        SELECT UNIX_TIMESTAMP();
PostgreSQL   SELECT EXTRACT(EPOCH FROM now());
Shell        date +%s

And to convert a timestamp back into a date: in JavaScript use new Date(ts * 1000), in Python datetime.fromtimestamp(ts, tz=timezone.utc), and on Linux date -d @1700000000 (on macOS, date -r 1700000000).

ISO 8601 and RFC 2822

ISO 8601 is the international standard for writing dates and times, used by JSON APIs, XML and most modern software: 2024-03-15T09:30:00Z. The date is written largest unit first, a T separates the time, and the suffix is either Z (UTC) or an offset such as +05:30. Because the format sorts alphabetically in chronological order, it is ideal for file names and logs. Always include the offset: a string without one is ambiguous, and browsers interpret it in the reader’s local time zone.

RFC 2822 (updated as RFC 5322) is the format used in email headers and HTTP-era systems, such as Fri, 15 Mar 2024 09:30:00 +0000.

Time zones and daylight saving time

A time zone is more than an offset from UTC. Zones such as America/New_York or Europe/Berlin carry a history of rules: when daylight saving time starts and ends and how those rules have changed over the decades. EpochClock uses these named IANA zones so that converting 15 January and 15 July in the same city gives the correct, different offsets.

Daylight saving creates two awkward cases when converting a local time to a timestamp. In spring, clocks jump forward, so a time such as 02:30 does not exist that day; the tool tells you and shows the time it maps to. In autumn, an hour repeats, so 01:30 happens twice; the tool uses the first occurrence. To avoid these problems entirely, store and transmit times as UTC timestamps and convert to local time only for display.

The year 2038 problem

Older systems store Unix time as a signed 32-bit integer, which can count only up to 2,147,483,647. That value is reached at 03:14:07 UTC on 19 January 2038, after which such counters overflow to a negative number and jump back to 1901. Modern 64-bit operating systems, databases and languages use 64-bit time values and are unaffected for billions of years, but embedded devices, old file formats and legacy database columns (for example MySQL’s TIMESTAMP type) can still be at risk. Enter 2147483647 above to see the exact moment.

Things to watch out for

Frequently asked questions

What is the current Unix timestamp?

It is shown live at the top of this page, in both seconds and milliseconds, and updates four times a second. It is calculated from your device’s clock, so it is only as accurate as that clock.

How do I know if a timestamp is in seconds or milliseconds?

Count the digits. Current dates have 10 digits in seconds and 13 in milliseconds; microseconds have 16 and nanoseconds 19. The converter detects this automatically, or you can choose the unit yourself.

Does a Unix timestamp depend on the time zone?

No. A timestamp counts seconds since 1 January 1970 UTC and represents the same instant everywhere. Only the human-readable form of that instant changes with the time zone.

How does the converter handle daylight saving time?

It uses named IANA time zones such as Europe/London, which include daylight-saving rules and their history. Converting a summer and a winter date in the same zone therefore gives the correct, different UTC offsets. Non-existent local times during the spring change are flagged.

What happens in 2038?

Systems that store time as a signed 32-bit number overflow at 03:14:07 UTC on 19 January 2038 (timestamp 2147483647). Modern 64-bit systems are not affected, but some older embedded systems and databases may need updating.

Can I convert dates before 1970?

Yes. Dates before the epoch have negative timestamps, and the converter handles them in both directions, within the range JavaScript supports (about 270,000 years either side of 1970).

Why is my converted date off by several hours?

This usually means the time was interpreted in a different time zone than intended, for example an ISO string without a Z or offset being read as local time. Make sure the zone is explicit, or choose the correct zone in the Date → timestamp section.