By FileToolsHub Editorial · Published 2026-09-27 · Unix
How to Convert Unix Timestamp to Date
Seconds versus milliseconds, and UTC versus local time, using the command line, JavaScript, or FileToolsHub on a log line.
Unix time counts seconds from 1970-01-01 00:00:00 UTC (the epoch). Logs, JWT exp claims, and APIs often store timestamps as integers. Mistaking seconds for milliseconds — or ignoring timezone — is the most common bug when debugging incidents. Mobile apps serialize `createdAt` as epoch milliseconds in JSON while backend logs use seconds — mixed APIs in one dashboard confuse teams until conversion is explicit.
Seconds vs milliseconds
10-digit values near 1.7 billion are usually seconds (2020s era). 13-digit values like 1_700_000_000_000 are milliseconds. JavaScript Date.now() returns milliseconds; Unix date command uses seconds. When in doubt, divide by 1000 if the number is huge and the date looks wrong in the year 50,000+.
Command line
macOS and Linux: date -r 1700000000 for UTC local display; date -u -r 1700000000 for UTC. GNU date: date -d @1700000000. Windows PowerShell: [DateTimeOffset]::FromUnixTimeSeconds(1700000000).
JavaScript console
new Date(1700000000 * 1000) for seconds input. Inspect toISOString() for UTC and toString() for local.
Browser tool
Paste the value into /tool/epoch-converter to see ISO, UTC, local, and both second/millisecond forms. Faster than mental math during on-call. Related: /tool/timezone-converter for meetings, /tool/iso8601-formatter for string normalization.
Timezones and DST
Epoch is UTC by definition; local display applies your OS timezone rules including daylight saving. Document which zone support teams use in runbooks — "local" without a zone name invites confusion.
Reverse conversion
Need date → epoch? The same tool often accepts ISO strings. In JS: Math.floor(Date.parse('2024-01-15T12:00:00Z')/1000).
On-call debugging workflow
When logs mix seconds and milliseconds, normalize in /tool/epoch-converter before comparing to ISO timestamps in another system. Write postmortems in UTC and convert for local readers only in the summary table. If your language API returns local time by default, pin tz=UTC in scripts that generate reports for distributed teams — document that choice in the README beside sample epoch values from production.
Milliseconds timestamps near year 2286 overflow 32-bit signed integers in legacy C code — know your field width in APIs. Nanosecond logs from Go or Java may need division before epoch conversion in seconds-only tools. Always label charts UTC or local in the axis title when presenting to executives. When correlating CDN logs with app logs, confirm both sides use the same epoch unit in JSON serializers. Browser Date parsing of human strings is forgiving but locale-dependent — prefer ISO input in tests. Store timezone identifiers (America/Chicago) in databases, not just offsets, for DST-safe reporting.
Spreadsheet cells showing #### may be too narrow for datetime display after conversion — widen columns. Excel 1900 date system differs from Unix epoch math — do not mix serial date columns with epoch columns without conversion. For API design, document whether clients should send seconds or milliseconds in OpenAPI examples to prevent off-by-1000 bugs in mobile apps. Monitoring tools often expose epoch in JSON; paste into /tool/epoch-converter alongside trace IDs when opening tickets. For JavaScript frontends, prefer Date.parse on ISO strings at API boundaries but store UTC instants internally. Document epoch unit in your README OpenAPI examples — mobile clients have shipped both seconds and milliseconds by mistake. Incident bridges should display UTC clocks beside local time so engineers in multiple regions agree on sequence. When parsing CSV logs, normalize epoch columns in Python with explicit unit tests for ten- and thirteen-digit samples. Grafana and Datadog let you toggle units in the UI — still verify raw JSON when screenshots disagree. Legacy PHP time() returns seconds; Java System.currentTimeMillis returns ms — grep your codebase for both when debugging. Keep a sticky note on your monitor with the current epoch seconds from /tool/epoch-converter when you debug time-sensitive tokens during deploy windows. When writing unit tests, assert both the integer epoch and the formatted ISO string so refactors do not silently change units. Pair with /tool/iso8601-formatter when logs mix offset formats.
FAQ
Is Unix time always UTC? Yes at storage; presentation may be local time with timezone.
What about negative timestamps? Before 1970 — valid, rare in consumer apps.
Do leap seconds matter? Most software ignores leap seconds in epoch counting.
Y2K38 problem? 32-bit signed seconds overflow in 2038 — use 64-bit in new systems. Paste suspicious integers into /tool/epoch-converter to see whether seconds or milliseconds matches reality.