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:
- Log analysis -- Production logs from systems like Kubernetes, Nginx, or application frameworks embed epoch timestamps in every line. A 500-line log excerpt might contain hundreds of timestamps you need to read.
- Data migration -- Moving data between systems that store dates differently. One system uses Unix seconds, another uses ISO 8601, and you need to verify the mapping is correct.
- Debugging distributed systems -- Correlating events across microservices where each service logs timestamps in a different format or timezone.
- Incident postmortems -- Building a timeline of events from mixed log sources where you need to convert and sort timestamps from different systems.
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:
| Format | Example | Digits |
|---|---|---|
| Unix seconds | 1711540800 | 10 |
| Unix milliseconds | 1711540800000 | 13 |
| Unix microseconds | 1711540800000000 | 16 |
| Unix nanoseconds | 1711540800000000000 | 19 |
| ISO 8601 | 2024-03-27T12:00:00Z | -- |
| Short date | 2024-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
- Bookmark the tool -- Having DevToolBox's Epoch Converter one click away saves time during incidents.
- Copy the full block -- Do not pre-filter your logs. Paste everything and let the parser find the timestamps.
- Check the unit -- If converted dates look like 1970, your timestamps are probably in milliseconds but being read as seconds (or vice versa). DevToolBox auto-detects the unit to prevent this.
Need to convert a batch of timestamps right now? Try batch conversion on DevToolBox -- paste your log and see every timestamp decoded instantly.