Convert a timestamp or date
GET/api/v2/time/convert
Reads a Unix timestamp, date string or relative time and returns it as Unix time in every unit, ISO 8601 in UTC and in a zone, RFC 9557 and RFC 2822. Free, no key needed. Precision is kept to the nanosecond
Free: no key needed and not counted towards your quota. Limited to 60 requests per minute per IP address
Parameters
| Name | In | Description |
|---|---|---|
valuerequired | query | A Unix timestamp (1793967600, 1793967600123, -86400, 1793967600.5), a date string (ISO 8601, RFC 3339, RFC 9557, RFC 2822, HTTP date, 2026-11-06 14:30, 6 Nov 2026, 11/06/2026) or a relative time (now, today, +90m, 3 days ago)Example: 1793967600 |
unitoptional | query | Unit of a numeric value. auto reads it from the size: below 10^11 seconds, below 10^14 milliseconds, below 10^17 microseconds, otherwise nanoseconds |
tzoptional | query | IANA time zone for zone. Defaults to UTCExample: America/New_York |
inoptional | query | IANA time zone for date strings without an offset, and for today, yesterday and tomorrow. Defaults to UTCExample: America/New_York |
disambiguationoptional | query | For a local time that happens twice when clocks go back: the earlier or later instant, or reject with an error. Times skipped when clocks go forward move forward by the gap unless this is reject |
orderoptional | query | How to read slashed dates such as 05/08/2026 when either part could be the day |
Example
curl "https://marketcalendars.com/api/v2/time/convert?value=1793967600&tz=America/New_York"const res = await fetch("https://marketcalendars.com/api/v2/time/convert?value=1793967600&tz=America/New_York");
const data = await res.json();import requests
data = requests.get("https://marketcalendars.com/api/v2/time/convert?value=1793967600&tz=America/New_York").json(){
"input": "1793967600",
"detected": {
"kind": "timestamp",
"unit": "s",
"format": "Seconds",
"zone": null
},
"seconds": 1793967600,
"milliseconds": 1793967600000,
"microseconds": "1793967600000000",
"nanoseconds": "1793967600000000000",
"utc": "2026-11-06T12:20:00Z",
"zone": {
"id": "America/New_York",
"local": "2026-11-06T07:20:00-05:00",
"rfc9557": "2026-11-06T07:20:00-05:00[America/New_York]",
"rfc2822": "Fri, 06 Nov 2026 07:20:00 -0500",
"offset": "-05:00",
"abbreviation": "EST",
"dst": false
},
"calendar": {
"weekday": "Friday",
"isoWeek": "2026-W45",
"dayOfYear": 310
},
"notes": [],
"alternatives": [
{
"unit": "ms",
"utc": "1970-01-21T18:19:27.600Z"
},
{
"unit": "us",
"utc": "1970-01-01T00:29:53.967600Z"
},
{
"unit": "ns",
"utc": "1970-01-01T00:00:01.793967600Z"
}
]
}A live response from the API. Lists longer than seven items are cut to three here
Response fields
TimeConversion object. Fields marked | null are always present and may be null
| Field | Type | Description |
|---|---|---|
| input | string | The value as sent |
| detected | object | How the value was read |
| detected.kind | string | What the value was read astimestampdaterelative |
| detected.unit | string | null | Unit of a timestamp; null otherwisesmsusns |
| detected.format | string | The format that was read, for people |
| detected.zone | string | null | Zone a local time was read in; null when the value carried its own offset |
| seconds | integer | Unix time in whole seconds, rounded down |
| milliseconds | integer | Unix time in whole milliseconds, rounded down |
| microseconds | string | Unix time in microseconds. A string, as it exceeds 2^53 |
| nanoseconds | string | Unix time in nanoseconds, exact. A string, as it exceeds 2^53 |
| utc | string (date-time) | ISO 8601 in UTC, with as many fraction digits as the value needs (0, 3, 6 or 9) |
| zone | object | |
| zone.id | string | IANA time zone |
| zone.local | string (date-time) | ISO 8601 in the zone, with its UTC offset |
| zone.rfc9557 | string | ISO 8601 with the offset and the zone in brackets (RFC 9557) |
| zone.rfc2822 | string | RFC 2822 date in the zone, whole seconds |
| zone.offset | string | UTC offset, ±HH:MM (±HH:MM:SS for local mean time before standard time) |
| zone.abbreviation | string | Zone abbreviation, or GMT±H where there is no common one |
| zone.dst | boolean | Whether summer time is in force |
| calendar | object | Calendar facts in the zone |
| calendar.weekday | string | Weekday in the zone |
| calendar.isoWeek | string | ISO 8601 week in the zone |
| calendar.dayOfYear | integer | Day of the year in the zone, 1 to 366 |
| notes | object[] | Anything worth knowing about how the value was read. Usually empty |
| notes[].type | string | Kind of notenonexistent-timeambiguous-timeday-firstmonth-firstleap-second |
| notes[].detail | string | What happened, for people |
| alternatives | object[] | null | For timestamps with unit=auto, the value read in each other unit. Null otherwise |
| alternatives[].unit | string | smsusns |
| alternatives[].utc | string | null | The value read in this unit, or null outside the years 1 to 9999 |
Errors
- 400invalid-parameterA path or query parameter is malformed, such as a date that is not YYYY-MM-DD
- 400unreadable-valueThe value is not a timestamp, date or relative time we can read, or is outside the years 1 to 9999
- 400invalid-local-timeWith disambiguation=reject, the local time falls in a clock change: it never happens or happens twice
- 429rate-limitedThe key sent more requests in a minute than its plan's burst limit, or the client sent too many invalid keys