ThisCalculator

Everyday

Epoch Time Converter: Unix Timestamp Explained

Updated · Standard formula, shown below

Date and time (UTC) 45,244.925926
Unix timestamp
1700000000 s
You entered
Timezone offset (hours from UTC)
0 h
You entered

An epoch time converter (also called a Unix timestamp converter) lets you turn a Unix timestamp—the number of seconds since January 1, 1970, 00:00:00 UTC—into a human-readable date and time, or do the reverse. You enter either a timestamp or a date, and you get back the corresponding value in the other format, usually with timezone adjustments.

Formula

The core formula for converting a Unix timestamp to a date is:

Date = (timestamp / 86400) + 25569 + (timezone_offset / 24)

  • timestamp – the Unix timestamp in seconds (integer)
  • 86400 – number of seconds in a day (60 × 60 × 24)
  • 25569 – the serial number for January 1, 1970, in Excel’s date system (which starts at January 1, 1900)
  • timezone_offset – hours added to UTC to get local time (e.g., +2 for Central European Summer Time)

The result is a serial date number (days since 1900-01-01) that you can format as a calendar date.

Worked Example

Using the defaults from the calculator: timestamp = 1,700,000,000 seconds, timezone offset = 0 (UTC).

  1. Divide the timestamp by 86400: 1,700,000,000 ÷ 86400 = 19675.9259259
  2. Add 25569: 19675.9259259 + 25569 = 45244.9259259
  3. Add timezone offset (0/24 = 0): 45244.9259259

The serial date 45244.9259259 corresponds to November 14, 2023, 22:13:20 UTC. The calculator shows this as a date-time value with 6 decimal places.

What Is Unix Time?

Unix time (also called POSIX time or epoch time) is a system for tracking time as the number of seconds that have elapsed since the Unix epoch: January 1, 1970, at 00:00:00 UTC. It ignores leap seconds—it is based on a fictional uniform time that assumes every day has exactly 86,400 seconds. This makes it simple for computers to store and compare timestamps as a single integer.

The term “epoch” in computing generally refers to a fixed point in time used as a reference. Unix chose 1970 because it was a convenient, round date at the start of the digital era. Other systems use different epochs: Windows uses 1601, and many spreadsheet programs use 1900 or 1904.

How to Convert a Timestamp to a Date

To convert a Unix timestamp to a human-readable date manually, you can follow these steps:

  1. Divide the timestamp by 86,400 to get days since the epoch.
  2. Add the result to January 1, 1970 (as a date).
  3. If you need local time, add your timezone offset in hours divided by 24.

For example, timestamp 0 is exactly January 1, 1970, 00:00:00 UTC. Timestamp 86400 is January 2, 1970, 00:00:00 UTC. Most programming languages have built-in functions (like date() in PHP, datetime.fromtimestamp() in Python) that do this automatically.

How to Convert a Date to a Timestamp

Going the other way—from a date to a Unix timestamp—requires the reverse process:

  1. Count the number of days between your date and January 1, 1970.
  2. Multiply by 86,400.
  3. Add the number of seconds since midnight on your date (hours × 3600 + minutes × 60 + seconds).
  4. Subtract your timezone offset in seconds (if you are converting a local time to UTC).

For example, January 2, 1970, 00:00:00 UTC is exactly 86,400 seconds. Most online converters and programming languages handle this automatically, but understanding the math helps you debug when things look wrong.

Common Problems and Pitfalls

  • Timezones – The biggest source of confusion. A timestamp is always UTC, but when you display it, you must add your local offset. Forgetting this can shift the date by a day.
  • Milliseconds vs. seconds – Many APIs return timestamps in milliseconds (e.g., 1700000000000). If you treat them as seconds, you get a date in 1970. Always check the unit.
  • Leap seconds – Unix time ignores them, so the displayed time may differ from actual atomic time by up to a second.
  • Negative timestamps – Dates before 1970 are represented as negative numbers. Some converters handle them poorly.
  • Year 2038 problem – On 32-bit systems, timestamps are stored as signed 32-bit integers, which overflow on January 19, 2038. Most modern systems use 64-bit integers, avoiding this.

Why Use an Epoch Converter?

Developers, system administrators, and data analysts use epoch converters daily. Common use cases include:

  • Debugging logs that show timestamps instead of readable dates.
  • Setting expiration times for tokens or cookies.
  • Converting database timestamps to a format for reports.
  • Comparing time values across different systems that use Unix time.

An online converter is handy when you need a quick answer without writing a script. It also helps you verify that your code is producing the correct timestamp.

Alternatives to an Online Converter

If you need to convert timestamps frequently, you might prefer:

  • Command line – On Linux/macOS, date -d @1700000000 converts to a date; date +%s gives the current timestamp.
  • Spreadsheets – Excel and Google Sheets can convert timestamps using formulas (as shown above).
  • Programming languages – Python, JavaScript, PHP, and others have built-in date/time functions.
  • Browser developer tools – The console can run new Date(1700000000 * 1000) in JavaScript.

Each method has its learning curve, but the underlying math is the same.

Frequently Asked Questions

What is the Unix epoch?

The Unix epoch is January 1, 1970, at 00:00:00 UTC. It is the reference point from which Unix time counts seconds. This date was chosen because it was a convenient, round date early in the computer era.

Why is my timestamp showing 1970?

If you see a date in 1970, it usually means the timestamp is too small—often because it is in milliseconds and you treated it as seconds. For example, 1700000000000 milliseconds equals 1700000000 seconds (Nov 2023), but if you divide by 1000, you get the correct seconds. Also, a timestamp of 0 is exactly the epoch.

How do I convert a timestamp to my local time?

Add your timezone offset in hours to the UTC time. For example, if you are in UTC+2, add 2 hours. Most converters have a timezone selector; if not, you can manually add the offset in the formula.

What is the year 2038 problem?

On 32-bit systems, Unix time is stored as a signed 32-bit integer, which can hold values up to 2,147,483,647. That number is reached on January 19, 2038. After that, the integer overflows and becomes negative, causing errors. Modern 64-bit systems avoid this because they can hold much larger numbers.

Can I convert dates before 1970?

Yes, dates before 1970 are represented as negative timestamps. For example, January 1, 1960, is approximately -315,619,200 seconds. Most converters handle negative values, but some older tools may not.

What is the difference between Unix time and ISO 8601?

Unix time is a single integer (seconds since 1970), while ISO 8601 is a text format like “2023-11-14T22:13:20Z”. Both represent the same moment, but ISO 8601 is human-readable and includes timezone information, while Unix time is easier for computers to compare.

Related

Formula used
in ts | Unix timestamp | s | 1700000000 | 0
in tz | Timezone offset (hours from UTC) | h | 0 | -12
out dt | Date and time (UTC) | - | (ts / 86400) + 25569 + (tz / 24) | 6

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.