# Timestamp Converter

> Convert Unix timestamps to dates and back, free online: auto-detects s/ms/µs/ns, compares timezones side by side with DST flags, and batch-converts log files.

- URL: https://bytescope.dev/en/timestamp/
- Locale: en · Also: [ja](https://bytescope.dev/ja/timestamp.md) · [zh-Hant](https://bytescope.dev/zh-Hant/timestamp.md)
- Runs: Everything runs locally in your browser — nothing is uploaded.
- Requires: Any modern browser (Chrome, Edge, Firefox, Safari), desktop and mobile.
- Updated: 2026-09-08

## What it does

Paste any Unix timestamp and this converter figures out the precision from its digit count — 10 digits are seconds, 13 milliseconds, 16 microseconds, 19 nanoseconds — and warns you when the result lands in an implausible year, which is the classic symptom of a precision mix-up. The output shows every format you'd reach for at once: ISO 8601, RFC 2822, your locale's format and a relative time ("3 days ago"), each with one-click copy.

The core feature is the timezone board: add as many IANA timezones as you need and read the same instant across all of them side by side — UTC next to Taipei next to your customer's timezone is the everyday reality of debugging distributed logs. Each row shows the current UTC offset and flags whether daylight saving is in effect, since DST transitions are where timestamp bugs hide. Your timezone set is remembered locally, and a live "now" readout with one-click copy covers the most common visit of all.

Everything runs in your browser using the built-in Intl API — no server, no account. The reverse direction (date picker + timezone → timestamp in seconds and milliseconds), a batch mode that converts a pasted column of log timestamps into a table with CSV export, and an input history (stored only in your browser, with one-click re-run and clear) round it out.

Three more layers sit on top: a custom output-format field (tokens YYYY, MM, DD, HH, mm, ss, SSS and Z, with `[literal text]` escaping) that live-previews as you type and lets you save formats you reuse; a duration calculator that takes two timestamps — each auto-detecting its own precision just like the main input — and reports which one comes first plus the gap as a day/hour/minute/second breakdown alongside the total in each single unit; and a shareable link, since the current tab, input and any manual precision override are kept in the URL hash via `replaceState`, so typing never floods your browser history but the address bar always matches what's on screen.

## Limits

Does not handle calendar recurrence or business-day arithmetic; it converts between Unix epochs, ISO strings and time zones.

## FAQ

### How does it know if my timestamp is seconds or milliseconds?

By digit count: 10 digits ≈ seconds, 13 ≈ milliseconds, 16 ≈ microseconds, 19 ≈ nanoseconds. If the converted date falls outside a plausible range (roughly 1970–2100), the tool warns you and lets you override the precision manually — a 10-digit number interpreted as milliseconds lands in 1970, which is how those bugs usually look.

### Why do my timestamp and my colleague's differ by exactly one hour?

Almost always daylight saving time or a timezone-offset assumption. Unix timestamps themselves have no timezone — they count seconds since 1970-01-01 UTC — so the difference appears when converting to local time. The timezone board shows each zone's current offset and DST status so you can spot exactly where the hour went.

### Is my input history uploaded anywhere?

No. History lives only in your browser's localStorage — each entry is just the number you converted and when. You can delete single entries or clear everything, and nothing syncs or leaves your device.

### Can I convert a whole column of timestamps from a log file?

Yes — batch mode accepts one timestamp per line (mixed precisions are fine, each line is auto-detected), converts them all into a table in your chosen timezone, and exports the result as CSV.

### What's the maximum date it supports?

JavaScript dates cover ±8.64e15 ms from the epoch — roughly the years 271821 BCE to 275760 CE — far beyond any realistic timestamp. The famous 2038 problem affects 32-bit Unix systems, not this converter.

### Can I define my own output format?

Yes — the custom format field accepts the tokens YYYY, MM, DD, HH, mm, ss, SSS and Z (Z is always +00:00, since formatting is UTC-based), and any text wrapped in square brackets is kept literal, e.g. `YYYY-MM-DD [at] HH:mm`. The preview updates as you type, and formats you use often can be saved — stored only in your browser.

### Can I find the gap between two timestamps?

Yes — switch to the Duration tab and enter both timestamps (each one auto-detects its own precision, the same as the main converter). It reports which is earlier and by how much, broken into days/hours/minutes/seconds, plus the total expressed in each single unit.

### Does this page keep a link to what I converted?

The URL's hash updates as you type — via `replaceState`, so it never adds new entries to your browser history — carrying the current tab, input, and any manually overridden precision. Copy the address bar to share or bookmark a specific conversion; opening that link restores exactly that state.
