ThisCalculator

Everyday

Epoch Time Converter Batch: How to Convert Many Timestamps

Updated · Standard formula, shown below

Date and time (UTC+offset) 44,197.00000
Timestamp (seconds)
1609459200
You entered
UTC offset (hours)
0
You entered

Epoch Time Converter Batch: How to Convert Many Timestamps

An epoch time converter batch tool converts multiple Unix timestamps (seconds since January 1, 1970 UTC) into human-readable dates and times in one operation, saving you from pasting each number individually. You enter a list of timestamps (one per line or separated by commas), and the tool returns each corresponding date and time, typically in UTC and your local timezone. This article explains how batch conversion works, why you might need it, and how to choose or use the right tool.

Formula

The core formula converts a Unix timestamp (seconds since 1970-01-01 00:00:00 UTC) to a date-time value. In spreadsheet terms (like Excel), dates are stored as serial numbers where day 1 is January 1, 1900. The conversion is:

date_serial = (timestamp / 86400) + 25569 + (offset_hours / 24)

  • timestamp – the Unix epoch time 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 (the number of days from 1900-01-01 to 1970-01-01).
  • offset_hours – your timezone’s offset from UTC (e.g., +2 for Central European Summer Time, -5 for Eastern Standard Time).

The result is a decimal number where the integer part is the day and the fractional part is the time of day. For example, 0.5 represents 12:00 noon.

Worked Example

Using the default timestamp 1609459200 (which is 2021-01-01 00:00:00 UTC) and offset 0:

  1. Divide by 86400: 1609459200 ÷ 86400 = 18628.0
  2. Add 25569: 18628 + 25569 = 44197.0
  3. Add offset (0/24 = 0): 44197.0

The result is 44197.0 – which corresponds to January 1, 2021, 00:00 UTC. If you set the offset to +2, the result becomes 44197.08333, which is 02:00 on the same day.

Why Batch Convert Epoch Times?

Unix timestamps appear in logs, databases, API responses, and file metadata. A single timestamp is easy to convert with any online tool, but when you have hundreds or thousands, manual conversion is impractical. Batch conversion is essential for:

  • Analyzing server logs where each line starts with a timestamp.
  • Cleaning data exported from databases that store dates as integers.
  • Converting timestamps from multiple timezones into a uniform format.
  • Debugging time-related bugs in applications.

Without batch conversion, you’d waste hours copying and pasting each value. A batch tool processes the entire list in seconds.

How to Choose a Batch Converter

Not all epoch converters handle batch input. When selecting a tool, look for:

  • Input format flexibility – accepts newline-separated, comma-separated, or space-separated lists.
  • Timezone support – allows you to specify an offset or choose a named timezone.
  • Output options – shows both UTC and local time, or lets you format the date (e.g., YYYY-MM-DD HH:MM:SS).
  • Milliseconds support – some timestamps are in milliseconds (13 digits) rather than seconds (10 digits). The tool should handle both or let you specify.
  • No upload required – for privacy, a tool that processes data in your browser is preferable to one that uploads your list to a server.

If you’re comfortable with command-line tools, you can also use `date -d @timestamp` in Linux or a simple script in Python or JavaScript to batch convert locally.

Common Problems and Mistakes

Batch conversion seems straightforward, but several pitfalls trip up users:

  • Milliseconds vs. seconds – A 13-digit number is milliseconds, not seconds. If you divide it by 1000 first, you get the correct time. Many tools assume seconds, so check the length.
  • Timezone confusion – Epoch time is always UTC. If you forget to add your local offset, the displayed time will be off by hours. Always specify your timezone or convert to UTC first.
  • Negative timestamps – Timestamps before 1970 are negative numbers. Some tools reject them or mishandle them. Make sure your converter supports negative values.
  • Leap seconds – Unix time ignores leap seconds, so the conversion is always exact to the second, but the actual UTC time may differ by a second on rare occasions. This is negligible for most uses.
  • Excel’s leap year bug – Excel incorrectly treats 1900 as a leap year, so the serial number offset (25569) is correct for dates after 1900-03-01, but for earlier dates you’d need a different offset. Since epoch times are all after 1970, this is not an issue.

Batch Conversion in Spreadsheets

If you have timestamps in a spreadsheet, you can convert them without a dedicated tool. In Excel or Google Sheets, use the formula:

=(A1/86400) + DATE(1970,1,1)

Then format the cell as a date and time. For milliseconds, divide by 86400000 instead. This works for a column of timestamps – just drag the formula down. This is effectively a batch conversion, and it gives you full control over formatting.

Command-Line Batch Conversion

For those who prefer scripting, a simple loop in Bash can convert a file of timestamps:

while read ts; do date -d @$ts; done < timestamps.txt

In Python, you can use the `datetime` module:

from datetime import datetime, timezone
with open('timestamps.txt') as f:
    for line in f:
        ts = int(line.strip())
        print(datetime.fromtimestamp(ts, tz=timezone.utc))

These methods are free, fast, and handle thousands of timestamps instantly. They also avoid any privacy concerns of uploading data to a web service.

Frequently Asked Questions

Can I convert timestamps in milliseconds with the same formula?

Yes, but you must divide the millisecond timestamp by 1000 first to get seconds, then apply the formula. Alternatively, divide by 86400000 (milliseconds per day) instead of 86400. Most batch converters have an option to specify the unit.

Why does my converted time show a different date than expected?

This usually happens because of timezone offset. If you’re in UTC+5 and you don’t add the offset, the time will appear 5 hours earlier. Always check whether the tool outputs UTC or local time, and adjust accordingly.

Can I convert a range of timestamps (e.g., every hour between two dates)?

Yes, many batch converters allow you to generate a sequence. If not, you can create the list yourself in a spreadsheet or script, then feed it to the converter. For example, in Excel, you can generate a column of timestamps by adding 3600 to the previous cell.

Is there a limit to how many timestamps I can convert at once?

Web-based tools may have a limit (e.g., 1000 lines) to prevent abuse. If you have more, consider using a spreadsheet or a local script, which can handle millions of rows without issue.

What is the epoch for Unix time?

The Unix epoch is January 1, 1970, 00:00:00 UTC. This date was chosen because it was a convenient round number at the time Unix was developed. All Unix timestamps count seconds from that moment, with negative values for earlier dates.

How do I convert a timestamp to a specific timezone like ‘America/New_York’?

Most online converters let you select a named timezone from a dropdown. If not, you can calculate the offset manually (e.g., EST is UTC-5, EDT is UTC-4). For a reliable conversion, use a tool that supports the IANA timezone database, or use a programming language with timezone libraries.

Related

Formula used
in t | Timestamp (seconds) | - | 1609459200 | 0
in tz | UTC offset (hours) | - | 0 | -12
out dt | Date and time (UTC+offset) | - | t / 86400 + 25569 + tz / 24 | 5

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.