Guide

What Is Epoch Time? (And How to Convert It to a Date)

Epoch time is just a count of seconds since a fixed starting point in 1970. This guide explains what it means, why it's called the "epoch," and how to turn it into a date.

If you have seen a field called epoch holding a number like 1700000000, that is epoch time — and it is exactly the same thing as a Unix timestamp. You can drop any such value into the epoch time converter to see the date instantly, but it helps to understand what the number actually represents.

What is epoch time?

Epoch time is the number of seconds that have elapsed since 00:00:00 UTC on 1 January 1970. That starting instant is called the Unix epoch. So 0 is the epoch itself, 1700000000 is 2023-11-14 22:13:20 UTC, and the number simply keeps counting up one per second.

Because it is a plain count of seconds in UTC, an epoch value points to the same instant everywhere on Earth — there is no time zone inside the number. The time zone only matters when you format it for a person to read.

Why is it called the "epoch"?

In computing, an epoch is the fixed reference point that a clock counts from. Unix-based systems chose 1 January 1970, 00:00:00 UTC as that origin, so "epoch time" literally means "time measured from the epoch." The name stuck and now applies well beyond Unix.

Epoch time, Unix timestamp, Unix time — are they the same?

Yes. These are different names for the same value:

They all mean "seconds since 1970-01-01 UTC." If you want the full background, see What Is a Unix Timestamp?

Seconds or milliseconds?

Epoch values are traditionally in seconds, but some platforms (JavaScript in particular) use milliseconds. The quickest way to tell for a current date is the digit count:

Convert epoch time to a date

Here is the same value, 1700000000 (seconds), turned into 2023-11-14 22:13:20 UTC in three common environments.

// JavaScript — Date works in milliseconds, so multiply by 1000
new Date(1700000000 * 1000).toISOString();
// "2023-11-14T22:13:20.000Z"
# Python — pass tz=timezone.utc for a clear UTC result
from datetime import datetime, timezone
datetime.fromtimestamp(1700000000, tz=timezone.utc)
# 2023-11-14 22:13:20+00:00
# Linux / macOS — the date command (-u prints UTC)
date -u -d @1700000000     # GNU:   Tue Nov 14 22:13:20 UTC 2023
date -u -r 1700000000      # macOS: Tue Nov 14 22:13:20 UTC 2023

In a hurry? Paste the value into the epoch time converter — it shows the date in UTC and your local zone, with seconds/milliseconds detected automatically.

Convert a date back to epoch time

The reverse direction returns the seconds since 1970. Be explicit about UTC:

Math.floor(Date.now() / 1000);                          // JS: current epoch time
Math.floor(Date.parse('2023-11-14T22:13:20Z') / 1000);  // 1700000000
from datetime import datetime, timezone
int(datetime(2023, 11, 14, 22, 13, 20, tzinfo=timezone.utc).timestamp())  # 1700000000
date -u -d '2023-11-14 22:13:20' +%s   # 1700000000  (GNU)
date +%s                                # current epoch time

For more languages and SQL, plus the time-zone gotchas, see How to Convert a Unix Timestamp to a Date.

Common questions


Related guides

Try the epoch time converter →