# Unix timestamp converter

Convert a Unix timestamp to a date, or a date to a Unix timestamp, in seconds and milliseconds.

- Endpoint: `POST https://setget.net/v1/tools/unix-timestamp` with JSON `{"input": {...}}`
- MCP: `run_tool` with `slug` = `unix-timestamp`
- Page: https://setget.net/tools/unix-timestamp

## Inputs

- `value` (required, string): A Unix timestamp, or a date and time to turn into one.
- `unit` (optional, string, one of `auto`, `seconds`, `milliseconds`, `microseconds`, `nanoseconds`, default `"auto"`): Unit of a numeric timestamp. "auto" judges by its size.
- `zone` (optional, string): Time zone for the "local" output, and for reading a date that has no offset.

## Example 1

```json
{"input":{"value":"1700000000"}}
```

Result:

```json
{"direction":"to_date","unit":"seconds","seconds":1700000000,"milliseconds":1700000000000,"utc":"2023-11-14T22:13:20Z","weekday":"Tuesday","local":null}
```

## Example 2: A date to a timestamp

```json
{"input":{"value":"2026-03-05T14:30:00+01:00"}}
```

Result:

```json
{"direction":"to_timestamp","unit":null,"seconds":1772717400,"milliseconds":1772717400000,"utc":"2026-03-05T13:30:00Z","weekday":"Thursday","local":null}
```

**How does "auto" tell seconds from milliseconds?** By size. Below 100,000,000,000 is read as seconds, below 100,000,000,000,000 as milliseconds, below 100,000,000,000,000,000 as microseconds, and anything larger as nanoseconds. Set "unit" if your value is unusual.

**Which time zone is a date read in?** The offset written in the date wins. Otherwise "zone" is used, and UTC if no zone is given.
