Batch Unix Timestamp Converter

When you are debugging a production incident at 2 AM, the last thing you want to do is manually convert timestamps one at a time. Batch conversion lets you paste an entire block of text and see every timestamp decoded at once.

When You Need Batch Conversion

Single-timestamp converters work fine for quick checks. But real-world scenarios often involve hundreds of timestamps in a single log file, database export, or API response. Common situations:

In all these cases, opening a converter and pasting timestamps one by one is painfully slow.

How DevToolBox Handles Batch Conversion

DevToolBox's Epoch Converter includes a log parser mode that automatically detects and converts timestamps embedded in arbitrary text. Here is how it works:

Paste Your Log, Get Results

Instead of extracting timestamps manually, paste the entire log block. DevToolBox scans the text, identifies every timestamp pattern, and converts them inline. For example, given this input:

[1711540800] Service started
[1711540823] Connection to database established
[1711540845] First request received from 10.0.0.1
[1711541100] Error: connection pool exhausted
[1711541105] Automatic retry triggered

Each bracketed timestamp is detected and converted to a human-readable date, making the timeline immediately clear.

Supported Formats

The auto-detection engine recognizes a wide range of timestamp formats:

FormatExampleDigits
Unix seconds171154080010
Unix milliseconds171154080000013
Unix microseconds171154080000000016
Unix nanoseconds171154080000000000019
ISO 86012024-03-27T12:00:00Z--
Short date2024-03-27--

The parser uses digit count to distinguish between units. A 10-digit number starting with a plausible epoch range is treated as seconds. A 13-digit number is milliseconds, and so on. This means you can mix formats in the same input and they will all be handled correctly.

Mixed-Format Logs

Real logs rarely use a single format. You might have application logs in epoch milliseconds alongside Nginx access logs with bracket-formatted seconds:

2024-03-27T12:00:00.000Z INFO  App started
1711540823000 DEBUG Connected to postgres://db:5432
[27/Mar/2024:12:01:00 +0000] "GET /api/health HTTP/1.1" 200
1711541100 ERROR Pool exhausted

DevToolBox handles mixed formats in a single paste, converting each timestamp to a consistent, readable format.

Doing It Programmatically

If you need batch conversion in a script rather than a GUI, here are quick approaches in common languages:

Python

import re
from datetime import datetime, timezone

log = """[1711540800] Service started
[1711540823] Connection established"""

for match in re.finditer(r'\b(\d{10})\b', log):
    ts = int(match.group(1))
    dt = datetime.fromtimestamp(ts, tz=timezone.utc)
    print(f"{ts} -> {dt.isoformat()}")

JavaScript

const log = `1711540800000 Service started
1711540823000 Connection established`;

log.match(/\b\d{13}\b/g)?.forEach((ms) => {
  console.log(`${ms} -> ${new Date(Number(ms)).toISOString()}`);
});

Bash (one-liner)

grep -oP '\b\d{10}\b' logfile.txt | while read ts; do
  date -u -d @"$ts" +"%Y-%m-%d %H:%M:%S UTC"
done

Tips for Faster Debugging

Need to convert a batch of timestamps right now? Try batch conversion on DevToolBox -- paste your log and see every timestamp decoded instantly.