Time calculators

Epoch Calculator

Updated Sep 4, 2026 By Jehan Wadia
Rate Formulas

Preferences & Settings

Live Epoch Clock — Current Unix Time

Seconds are 10 digits, milliseconds are 13 digits (1 second = 1,000 milliseconds = 1,000,000 microseconds = 1,000,000,000 nanoseconds).

Seconds 10 digits
Milliseconds 13 digits
Microseconds 16 digits
Nanoseconds 19 digits
Current date Current time
Runs every converter below with the values currently entered.

Epoch Timestamp → Human-Readable Date

The unit is auto-detected from the digit count.
Interpretations

Date & Time → Epoch Timestamp

Enter each part of the date and time
Epoch Result

Date String → Epoch Timestamp

Examples: 2026-09-04T14:30:00Z · Fri, 04 Sep 2026 14:30:00 +0000 · 09/04/2026 2:30 PM · 04-09-2026 · September 4, 2026 · tomorrow · next Monday · 3 days ago · in 6 hours
Epoch Result

Epoch Range — Start & End of Period

Granularity
Period Boundaries

Epoch Difference Calculator

Difference Results
Step-by-Step Solution
Difference Breakdown

Batch Epoch Converter

0 lines, 0 characters
Input Detected unit UTC date & time Selected timezone Relative Copy

Introduction

Computers do not store dates the way people write them. Instead, they count the number of seconds that have passed since January 1, 1970 at 00:00:00 UTC. That count is called the Unix epoch timestamp. A number like 1788480000 looks like nonsense to us, but to a computer it is an exact moment in time.

This Epoch Converter turns those numbers into normal dates, and normal dates back into numbers. It works with seconds, milliseconds, microseconds, and nanoseconds, and it figures out the unit for you by counting the digits.

Here is what you can do with it:

  • See the live clock. Watch the current epoch time tick in four units, and copy any of them with one click.
  • Convert a timestamp to a date. Paste any epoch number and get the full date and time in UTC and in your chosen timezone.
  • Convert a date to a timestamp. Type the month, day, year, and time, or use the date picker.
  • Type plain text. Enter things like "September 4, 2026", "tomorrow", "3 days ago", or "in 6 hours".
  • Find start and end times. Get the first and last second of any year, month, day, or hour.
  • Compare two times. See the gap in days, hours, minutes, and seconds, with the math shown step by step.
  • Convert a whole list. Paste up to 500 timestamps at once and copy all the results.

Pick your timezone, date format, and 12- or 24-hour clock in the settings at the top. Everything runs right in your browser, so your data never leaves your device. Developers use a converter like this when reading log files, checking API responses, debugging databases, or setting expiry times.

How to use our Epoch Calculator

Type a Unix timestamp or a date, and this tool shows you the matching date, time, epoch number, time range, or time gap in seconds, minutes, hours, and days.

Regional locale: Pick your region, or leave it on Auto-detect, and the date and clock style are set for you.

Clock display format: Choose 12-hour (AM/PM) or 24-hour time for every result on the page.

Date input / display format: Choose Y-M-D, M/D/Y, or D-M-Y so dates read the way you expect.

Default timestamp unit: Pick seconds or milliseconds. This is the unit used when you click any "use now" button.

Default timezone: Choose UTC, your local time, or any city zone. All date results use this zone.

Show UTC + selected timezone: Turn this on to see both UTC and your chosen zone side by side.

Pause live clock: Click it to freeze the live epoch clock so you can read or copy a value. Click again to resume.

Unix timestamp (Epoch → Date): Enter your number. The tool counts the digits and guesses seconds, milliseconds, microseconds, or nanoseconds, then shows the date for each one.

Month, Day, and Year: Type each part of the date, or click "Pick date" to choose a day on the calendar.

Hours, Minutes, and Seconds: Type the time of day. In 12-hour mode, also pick AM or PM.

Timezone (Date → Epoch): Pick the zone your date and time belong to, then click Convert to get the epoch number.

Date string: Type any date text like 2026-09-04T14:30:00Z, September 4, 2026, tomorrow, or 3 days ago to get its epoch value.

Granularity: Choose Year, Month, Day, or Hour to set how wide the time period is.

Year, Month, Day, and Hour (range): Fill the boxes that show up. The tool gives the first and last epoch second of that period.

Timestamp A and Timestamp B: Enter two epoch numbers or two dates to find the gap between them.

Unit for A and Unit for B: Leave on Auto-detect, or pick seconds, milliseconds, microseconds, or nanoseconds yourself.

Batch list: Paste up to 500 timestamps, one per line, then click "Convert list" to see all dates in a table and copy them at once.

What Is Epoch Time?

Epoch time, also called Unix time or a Unix timestamp, is a way computers keep track of time. It counts the number of seconds that have passed since January 1, 1970 at 00:00:00 UTC. That moment is called the Unix epoch. So a timestamp like 1788480000 just means "1,788,480,000 seconds after the start of 1970."

Why Computers Use It

A date like "September 4, 2026, 2:30 PM" is easy for people to read, but hard for computers to sort and compare. Months have different lengths, years can be leap years, and every country writes dates in its own order. Epoch time fixes all of that. It is one plain number, always counting up, always based on UTC. That makes it simple to store in databases, send between servers, and use to find the gap between two events.

Seconds, Milliseconds, and Smaller Units

Different systems store epoch time with different accuracy. You can usually tell which unit you have by counting the digits:

  • 10 digits. Seconds (used by Unix, Linux, PHP, and most APIs)
  • 13 digits. Milliseconds (used by JavaScript and Java)
  • 16 digits. Microseconds (used by Python and some log files)
  • 19 digits. Nanoseconds (used by Go and high-speed systems)

Each step up is 1,000 times smaller. So 1 second = 1,000 milliseconds = 1,000,000 microseconds = 1,000,000,000 nanoseconds. If you read a timestamp with the wrong unit, your date can be off by decades, so the digit count matters.

Epoch Time and Time Zones

A Unix timestamp has no time zone built in. It always points to the same exact moment everywhere on Earth. The time zone only matters when you turn that number into a readable date. The timestamp 1788480000 is noon in London and 7:00 AM in New York. Same instant, different clock reading. This is why servers store timestamps in UTC and only convert to local time when showing them to a person.

Handy Numbers to Know

  • 1 minute = 60 seconds
  • 1 hour = 3,600 seconds
  • 1 day = 86,400 seconds
  • 1 week = 604,800 seconds
  • 1 average year = about 31,557,600 seconds

To find the time between two events, just subtract the smaller timestamp from the bigger one. Divide the answer by 86,400 to get days, or by 3,600 to get hours.

The Year 2038 Problem

Older systems store epoch time in a signed 32-bit number. That number runs out on January 19, 2038, and would flip to a negative value, sending the date back to 1901. Most modern software now uses 64-bit numbers, which will not run out for billions of years. Older hardware and legacy code still need updating.

Where You Will See Epoch Timestamps

Epoch time shows up in server logs, API responses, JSON data, JWT tokens (the iat and exp fields), cookie expiry dates, database records, file timestamps, and cache headers. Developers, sysadmins, and data analysts convert these numbers to readable dates every day when debugging errors or lining up events from different systems.


Formulas used

Unit conversion to milliseconds
t_{ms} = v \cdot 1000 \;(\text{s}),\quad v \;(\text{ms}),\quad \frac{v}{1000}\;(\mu\text{s}),\quad \frac{v}{10^{6}}\;(\text{ns})
Signed difference between two timestamps
\Delta t = t_B - t_A
Total elapsed units from milliseconds
s = \frac{|\Delta t|}{1000},\quad m = \frac{|\Delta t|}{60000},\quad h = \frac{|\Delta t|}{3600000},\quad d = \frac{|\Delta t|}{86400000}
Days / hours / minutes / seconds breakdown
\begin{aligned} T &= \left\lfloor \frac{|\Delta t|}{1000} \right\rfloor \\ D &= \left\lfloor \frac{T}{86400} \right\rfloor \\ H &= \left\lfloor \frac{T - 86400D}{3600} \right\rfloor \\ M &= \left\lfloor \frac{T - 86400D - 3600H}{60} \right\rfloor \\ S &= T - 86400D - 3600H - 60M \end{aligned}
Epoch seconds from epoch milliseconds
t_s = \left\lfloor \frac{t_{ms}}{1000} \right\rfloor
Timezone offset and local-time to epoch conversion
\text{offset} = t_{\text{wall as UTC}} - t_{ms}, \qquad t_{ms} = t_{\text{wall as UTC}} - \text{offset}
End of a period (start of next period minus 1 ms)
t_{\text{end}} = t_{\text{next start}} - 1\;\text{ms}, \qquad \text{span} = \frac{t_{\text{next start}} - t_{\text{start}}}{86400000}\;\text{days}
Relative time unit thresholds (seconds)
n = \left\lfloor \frac{|\Delta t|/1000}{U} \right\rfloor,\quad U \in \{31557600, 2629800, 604800, 86400, 3600, 60, 1\}

Frequently asked questions

Why does Unix time start on January 1, 1970?

Engineers at Bell Labs picked that date in the early 1970s while building Unix. They needed a simple starting point that was close to the present day but easy to remember, so they chose the first second of 1970 in UTC. There is no deeper meaning to it. Once Unix spread, almost every other system copied the same start date so timestamps would match.

Does Unix time count leap seconds?

No. Unix time pretends every day has exactly 86,400 seconds, even when the world's clocks add a leap second. When a leap second happens, most systems either repeat a second or slow the clock down slightly (called "smearing"). This keeps the math simple, but it means Unix time is not a perfect count of real seconds since 1970. It runs about 27 seconds behind atomic time (TAI).

Can a Unix timestamp be a negative number?

Yes. Any moment before January 1, 1970 is a negative number. For example:

  • 0 = January 1, 1970, 00:00:00 UTC
  • -86400 = December 31, 1969
  • -2208988800 = January 1, 1900

Some older software refuses negative values, so very old birth dates or historic records can break in those systems.

Why does my date show up as January 1, 1970?

That almost always means the timestamp was empty, zero, or read with the wrong unit. Two common causes:

  • The value was 0 or null, which is the epoch itself.
  • A 10-digit seconds value was fed into code that expects milliseconds. Divided by 1,000, it lands in January 1970.

Check the digit count first: 10 digits is seconds, 13 is milliseconds.

How do I convert a Unix timestamp in Excel or Google Sheets?

Excel counts days, not seconds, so divide first:

  • Seconds: =(A1/86400)+DATE(1970,1,1)
  • Milliseconds: =(A1/86400000)+DATE(1970,1,1)

Then format the cell as a date and time. To go the other way: =(A1-DATE(1970,1,1))*86400. The result is UTC, so add or subtract hours if you want local time.

How do I convert epoch time in MySQL or PostgreSQL?

Each database has built-in functions:

  • MySQL: SELECT FROM_UNIXTIME(1788480000); and SELECT UNIX_TIMESTAMP('2026-09-04 12:00:00');
  • PostgreSQL: SELECT to_timestamp(1788480000); and SELECT EXTRACT(EPOCH FROM now());
  • SQLite: SELECT datetime(1788480000, 'unixepoch');

If your column holds milliseconds, divide by 1000 before converting.

How do I get or convert epoch time in Python and JavaScript?

Python works in seconds, JavaScript works in milliseconds.

  • Python now: time.time(). Convert: datetime.fromtimestamp(ts, tz=timezone.utc).
  • JavaScript now: Date.now() gives milliseconds; use Math.floor(Date.now()/1000) for seconds. Convert: new Date(ts * 1000).

Mixing the two units is the number one cause of dates that are wildly wrong.

How do I convert epoch time in the Linux terminal?

Use the date command:

  • Current epoch: date +%s
  • Timestamp to date: date -d @1788480000 -u
  • Date to timestamp: date -d "2026-09-04 12:00:00 UTC" +%s

On macOS the syntax differs: use date -r 1788480000.

Does epoch time change when daylight saving time starts?

No. The timestamp keeps counting straight through, one second at a time. Only the readable date changes. When clocks jump forward, the same epoch number simply displays one hour later on a local clock. This is why servers store epoch or UTC values and convert to local time only at the moment they show it to a person. DST can never corrupt the stored data.

Are there other epochs besides 1970?

Yes, several systems count from different start dates:

  • Windows FILETIME: January 1, 1601, in 100-nanosecond ticks
  • NTP: January 1, 1900
  • GPS time: January 6, 1980
  • Excel: January 1, 1900, counted in days
  • Apple Cocoa: January 1, 2001

If a number does not convert to a sensible date, it may use one of these instead of the Unix epoch.

What do iat and exp mean in a JWT token?

They are Unix timestamps in seconds. iat means "issued at", the time the token was created. exp means "expires", the moment it stops working. A server compares exp to the current epoch time; if the current time is larger, the token is rejected. Converting these numbers to a date is the fastest way to see whether a login token expired.

How do I add days or hours to a Unix timestamp?

Just add seconds. One hour is 3,600, one day is 86,400, and one week is 604,800. So 7 days after 1788480000 is 1788480000 + 604800 = 1789084800.

Careful: this works perfectly for exact spans of time, but not for calendar rules. Adding 86,400 across a daylight saving change lands on a different clock hour, and months and years vary in length, so use a date library for those.

What is the difference between a Unix timestamp and ISO 8601?

Both point to the same instant, but they look different. A Unix timestamp is a plain number like 1788480000. ISO 8601 is text like 2026-09-04T12:00:00Z, where the Z means UTC. Timestamps are smaller and easier to sort or subtract. ISO strings are readable by people and can carry a time zone offset such as +05:30. APIs use both, so it helps to read each one.