Unix timestamp converter

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

Input

A Unix timestamp, or a date and time to turn into one.
Unit of a numeric timestamp. "auto" judges by its size.
Time zone for the "local" output, and for reading a date that has no offset.

Result

Fill in the input and press Run.

Your input is processed in memory and then discarded. It is not stored or logged. Even so, don't paste live passwords or keys into any online tool.

Use it from code or an agent

curl -s https://setget.net/v1/tools/unix-timestamp \
  -H 'Content-Type: application/json' \
  -d '{"input":{"value":"1700000000"}}'
import json, urllib.request

body = {'input': {'value': '1700000000'}}
request = urllib.request.Request("https://setget.net/v1/tools/unix-timestamp", json.dumps(body).encode(),
                                 {"Content-Type": "application/json"})
print(json.load(urllib.request.urlopen(request))["result"])
const response = await fetch("https://setget.net/v1/tools/unix-timestamp", {
  method: "POST",
  headers: {"Content-Type": "application/json"},
  body: JSON.stringify({"input":{"value":"1700000000"}}),
});
console.log((await response.json()).result);
Tool: run_tool
Arguments:
{
  "slug": "unix-timestamp",
  "input": {
    "value": "1700000000"
  }
}
{
  "input": {
    "value": "1700000000"
  }
}

Endpoint: POST /v1/tools/unix-timestamp. Over MCP: run_tool with slug: "unix-timestamp". Machine-readable: input schema, Markdown. Connect an agent.

Inputs

NameTypeRequiredWhat it does
value string yes A Unix timestamp, or a date and time to turn into one.
unit string no Unit of a numeric timestamp. "auto" judges by its size. One of: auto, seconds, milliseconds, microseconds, nanoseconds. Default: "auto".
zone string no Time zone for the "local" output, and for reading a date that has no offset.

Examples

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

A date to a timestamp

Input
{
  "value": "2026-03-05T14:30:00+01:00"
}
Result
{
  "direction": "to_timestamp",
  "unit": null,
  "seconds": 1772717400,
  "milliseconds": 1772717400000,
  "utc": "2026-03-05T13:30:00Z",
  "weekday": "Thursday",
  "local": null
}

Questions

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.