# Unix Timestamp Converter

- **URL:** https://codeasystem.com/calculators/developer/timestamp-converter/
- **Category:** developer
- **Description:** Convert Unix seconds, milliseconds or ISO 8601 strings into every other format automatically, with relative-time context included.
- **Primary output:** ISO UTC string: 2023-11-14T22:13:20.000Z

## Inputs
- Timestamp or date (name: `value`, type: text, example: 1700000000 · 1700000000000 · 2023-11-14T22:13:20Z)

## Outputs
- ISO UTC string: 2023-11-14T22:13:20.000Z
- Unix seconds: 1,700,000,000
- Unix milliseconds: 1,700,000,000,000
- Input interpreted as: Unix seconds
- Relative to now: 2.8 years ago

## Formula / methodology
```
ms > 1e11 → read as milliseconds; else seconds; then derive all other representations
```

Purely numeric input auto-detects its unit by magnitude: absolute values above one hundred billion can only be milliseconds, anything smaller reads as seconds. Non-numeric input attempts ISO 8601 parsing through the standard Date constructor.

Once parsed, the instant renders simultaneously as Unix seconds, Unix milliseconds and an ISO UTC string, plus a coarse relative description (“in 3 days”, “2 hours ago”) computed against your current clock for instant sanity checking.

## Assumptions & limitations
- All output is UTC; local time zones affect display only.
- Magnitude detection assumes modern epochs; dates before 1973 in seconds look like milliseconds edge cases.
- Leap seconds are ignored, per Unix-time convention.

## How to use
1. **Paste any timestamp form**; Epoch seconds from a database, milliseconds from JavaScript, or an ISO string from an API log.
2. **Read all representations**; Seconds, milliseconds and ISO UTC appear together so cross-format debugging takes one glance.
3. **Sanity-check relatively**; The “X ago” row instantly exposes unit mistakes; a wrong guess reads as millennia away.

## Example
The round number 1,700,000,000 seconds lands on 2023-11-14T22:13:20Z; late evening UTC, handy for spotting off-by-a-day bugs.

Result for these inputs:

```
ISO UTC string: 2023-11-14T22:13:20.000Z
```

## About this calculator
### Why magnitude auto-detection works

Seconds since 1970 crossed 1e11 only around the year 5138; milliseconds passed that mark in 1973. The threshold cleanly separates the two formats for any realistic timestamp, making conversion frictionless without a mode switch.

### Timestamp bugs worth avoiding

- Storing seconds in a millisecond column (or vice versa) silently corrupts sorting
- new Date(string) parses differently across engines for non-ISO strings
- Always serialize UTC; convert to local time only at display
- JavaScript Date lacks minutes-level precision beyond ±8.64e15 ms

## FAQs
### How does it tell seconds from milliseconds?

Pure numbers with absolute value over 100 billion are treated as milliseconds; otherwise seconds. Dates before 1973 are the rare ambiguity zone.

### Is the ISO output always UTC?

Yes; toISOString() is defined as UTC with Z suffix. Convert to your time zone at presentation time, never before storage.

### Can I convert negative timestamps?

Yes; pre-1970 dates work as negative seconds/milliseconds throughout.

### Why does my relative time say “55 years ago” for a small number?

You likely pasted milliseconds into what was interpreted as seconds (or vice versa). The “interpreted as” row shows exactly which reading happened.

## Related calculators
- [ULID Generator](https://codeasystem.com/calculators/developer/ulid-generator/)
- [Cron Expression Parser](https://codeasystem.com/calculators/developer/cron-parser/)
- [Regex Tester](https://codeasystem.com/calculators/developer/regex-tester/)

---
Last updated: 2026-08-23 · Version: 1.0.0 · [HTML version](https://codeasystem.com/calculators/developer/timestamp-converter/)
