# Unix Timestamp Converter

> Converts a Unix timestamp (seconds or milliseconds since 1970-01-01T00:00:00Z, auto-detected) to a UTC and local date-time, or an ISO 8601 date-time (with optional time, offset or IANA zone) to epoch seconds and milliseconds, plus weekday, day of year and ISO week.

- Calculator id: `unix-timestamp` · Category: Time & Geography (`time`) · Tool name: `convert_unix_timestamp`
- Canonical page: https://tttkmbb.com/time/unix-timestamp · This document: https://tttkmbb.com/time/unix-timestamp.md · JSON definition: https://tttkmbb.com/time/unix-timestamp.json

## Purpose

Converts a Unix timestamp (seconds or milliseconds since 1970-01-01T00:00:00Z, auto-detected) to a UTC and local date-time, or an ISO 8601 date-time (with optional time, offset or IANA zone) to epoch seconds and milliseconds, plus weekday, day of year and ISO week.

**Use when:** You need to decode an epoch value from logs or an API, or produce the epoch seconds for a given calendar date and time.

**Do not use when:** You need Julian Day numbers (use julian-date) or wall-clock conversion between two cities (use time-zone-converter).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `timestamp` | number |  | optional | Seconds since the Unix epoch; values with \|timestamp\| > 1e11 are read as milliseconds. Takes precedence over datetime when both are given. (min -1000000000000000, max 1000000000000000) |
| `datetime` | string |  | optional | ISO 8601 date-time to convert instead of a timestamp: YYYY-MM-DD[THH:MM[:SS]] with optional Z or ±HH:MM offset; without an offset it is read in time_zone. |
| `time_zone` | string |  | optional, default "UTC" | IANA zone used to interpret a datetime without offset and to report the local date-time. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `unix_seconds` | integer | s | Whole seconds since 1970-01-01T00:00:00Z (floored). |
| `unix_milliseconds` | integer | ms | Milliseconds since the Unix epoch. |
| `iso_utc` | string |  | Instant in UTC, e.g. 2023-11-14T22:13:20Z (milliseconds shown only when non-zero). |
| `utc_string` | string |  | RFC 7231 / RFC 1123 form, e.g. Tue, 14 Nov 2023 22:13:20 GMT. |
| `local_datetime` | string |  | Instant in time_zone with its UTC offset (ISO 8601). |
| `utc_offset` | string |  | Offset of time_zone at that instant (±HH:MM). |
| `day_of_week` | string |  | Day of the week of the UTC date. |
| `day_of_year` | integer |  | Ordinal day of the UTC date, 1 January = 1. |
| `iso_week_date` | string |  | UTC date in ISO 8601 week notation YYYY-Www-D. |
| `interpretation` | string |  | How the input was read (seconds, milliseconds, explicit offset or zone). |

## Formula

`unix_seconds = floor((instant − 1970-01-01T00:00:00Z) / 1 s); |timestamp| > 1e11 → milliseconds, else seconds; datetime without offset: instant = wall time − offset(time_zone)`

Unix time counts SI seconds ignoring leap seconds (POSIX definition), so every day has exactly 86,400 s. Supported instants: years 1 to 9999.

## Data Sources

- IEEE Std 1003.1 (POSIX) – Seconds Since the Epoch — https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16 (standard, retrieved 2026-09-24)
- Unix time (Wikipedia) — https://en.wikipedia.org/wiki/Unix_time (reference, retrieved 2026-09-24)
- ISO 8601 – Date and time format (Wikipedia) — https://en.wikipedia.org/wiki/ISO_8601 (reference, retrieved 2026-09-24)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/unix-timestamp?`
- `POST https://tttkmbb.com/api/v1/calculate/unix-timestamp` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/unix-timestamp · OpenAPI operationId `convert_unix_timestamp` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "unix-timestamp", "inputs": {…}}`

## Example

- Timestamp 1700000000: inputs `{"timestamp":1700000000}` → `{"unix_seconds":1700000000,"unix_milliseconds":1700000000000,"iso_utc":"2023-11-14T22:13:20Z","utc_string":"Tue, 14 Nov 2023 22:13:20 GMT","local_datetime":"2023-11-14T22:13:20+00:00","day_of_week":"Tuesday","day_of_year":318,"iso_week_date":"2023-W46-2"}`
- 2026-09-23 09:00 in Australia/Adelaide: inputs `{"datetime":"2026-09-23T09:00","time_zone":"Australia/Adelaide"}` → `{"unix_seconds":1790119800,"iso_utc":"2026-09-22T23:30:00Z","local_datetime":"2026-09-23T09:00:00+09:30","utc_offset":"+09:30","day_of_week":"Tuesday","day_of_year":265}`

```
GET https://tttkmbb.com/api/v1/calculate/unix-timestamp?timestamp=1700000000
```

## Limitations

You need Julian Day numbers (use julian-date) or wall-clock conversion between two cities (use time-zone-converter). Unix time counts SI seconds ignoring leap seconds (POSIX definition), so every day has exactly 86,400 s. Supported instants: years 1 to 9999. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**How do you tell seconds from milliseconds?**

Any absolute value above 1e11 is treated as milliseconds (1e11 s would be the year 5138), so 1700000000 is seconds and 1700000000000 is milliseconds.

**Are leap seconds counted?**

No. Unix time is defined without leap seconds; the 27 leap seconds inserted since 1972 are absorbed by repeating a second, so conversions here match POSIX and every standard library.

## Related

- [Julian Date Calculator](https://tttkmbb.com/time/julian-date.md) — Astronomical Julian Day for the same instant.
- [Time Zone Converter](https://tttkmbb.com/time/time-zone-converter.md) — Wall-clock time of the instant in another zone.
- [Date Difference Calculator](https://tttkmbb.com/everyday/date-difference.md) — Days between two calendar dates.
