Unix timestamp converter
Convert between Unix seconds, milliseconds and zone-aware ISO times. Explicitly labels epoch 0, s/ms units, UTC (Z) and the chosen time zone so local wall-clock time is never mistaken for UTC.
Inputs and parameters
input— Timestamp or zone-aware ISO time (empty = current real time)unit— UnittimeZone— Display time zone (IANA name, e.g. Asia/Shanghai)
Real example
unit=s, input=0; and unit=auto, input=1700000000000
→ 0 → seconds=0, milliseconds=0, isoUtc=1970-01-01T00:00:00.000Z (UTC, Z); 1700000000000 → interpretedUnit=ms, seconds=1700000000, isoUtc=2023-11-14T22:13:20.000Z
Limits and failure handling
Single-instant conversion only: no batch, duration, leap-second or calendar conversion; limited by the JavaScript Date range ±8.64e15 ms. Auto unit uses |n| ≥ 1e11 for ms — choose s/ms explicitly near the boundary. Input cap 256 bytes.
FAQ
What is 0?
The Unix epoch: 1970-01-01T00:00:00.000Z, 0 in both seconds and ms; shown as 1970-01-01T08:00:00 in Asia/Shanghai.
Why reject ISO strings without a zone?
Because environments would implicitly apply their local zone and results would not be reproducible; a trailing Z or ±HH:MM is required.