{"openapi":"3.1.0","info":{"title":"DateTime API","version":"1.0.0","description":"A fast, fully-local date and time toolkit (UTC): parse any date string or unix timestamp into ISO, unix and components with the ISO week number, day-of-year and leap-year flag; format dates with custom tokens (YYYY-MM-DD, weekday and month names, and more); add or subtract month-aware durations; compute the difference between two dates in every unit plus a human-readable summary; and convert between unix timestamps and ISO. Every endpoint accepts input via the query string or the request body. Pure server-side compute, no third-party upstream, so responses are instant and always available. Ideal for scheduling, billing periods, reminders, analytics and any date arithmetic. (For the current time in a specific timezone, see the oanor Time API.)","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/datetime-api","description":"oanor gateway"}],"tags":[{"name":"DateTime"}],"components":{"securitySchemes":{"oanorKey":{"type":"apiKey","in":"header","name":"x-oanor-key","description":"Get your key at https://www.oanor.com/developer/keys"}}},"security":[{"oanorKey":[]}],"paths":{"/v1/add":{"get":{"operationId":"get_v1_add","tags":["DateTime"],"summary":"Add/subtract a duration","description":"","parameters":[{"name":"date","in":"query","required":true,"description":"Date string","schema":{"type":"string"},"example":"2026-05-30T00:00:00Z"},{"name":"years","in":"query","required":false,"description":"Years","schema":{"type":"string"},"example":"0"},{"name":"months","in":"query","required":false,"description":"Months","schema":{"type":"string"},"example":"0"},{"name":"days","in":"query","required":false,"description":"Days","schema":{"type":"string"},"example":"10"},{"name":"hours","in":"query","required":false,"description":"Hours","schema":{"type":"string"},"example":"0"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"input":"2026-05-30T00:00:00Z","result_iso":"2026-06-09T00:00:00.000Z","result_unix":1780963200},"meta":{"timestamp":"2026-05-30T09:00:23.150Z","request_id":"0d573f08-6622-4519-b40f-e846ddd34f8b"},"status":"ok","message":"OK","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/diff":{"get":{"operationId":"get_v1_diff","tags":["DateTime"],"summary":"Difference between two dates","description":"","parameters":[{"name":"from","in":"query","required":true,"description":"Start","schema":{"type":"string"},"example":"2026-01-01T00:00:00Z"},{"name":"to","in":"query","required":true,"description":"End","schema":{"type":"string"},"example":"2026-05-30T00:00:00Z"},{"name":"unit","in":"query","required":false,"description":"Single unit (omit for all)","schema":{"type":"string"},"example":"days"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"to":"2026-05-30T00:00:00.000Z","from":"2026-01-01T00:00:00.000Z","unit":"days","human":"4 months, 27 days","value":149},"meta":{"timestamp":"2026-05-30T09:00:23.222Z","request_id":"e62ac9eb-557b-4009-ada9-6e7f9c955d9c"},"status":"ok","message":"OK","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/format":{"get":{"operationId":"get_v1_format","tags":["DateTime"],"summary":"Format a date","description":"","parameters":[{"name":"date","in":"query","required":true,"description":"Date string or unix timestamp","schema":{"type":"string"},"example":"2026-05-30T08:05:09Z"},{"name":"format","in":"query","required":false,"description":"Token format","schema":{"type":"string"},"example":"dddd, DD MMMM YYYY"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"input":"2026-05-30T08:05:09Z","format":"dddd, DD MMMM YYYY","formatted":"Saturday, 30 May 2026"},"meta":{"timestamp":"2026-05-30T09:00:23.289Z","request_id":"dbcfd791-b964-4c3b-a8bc-e0f4e3a6f5f0"},"status":"ok","message":"OK","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/parse":{"get":{"operationId":"get_v1_parse","tags":["DateTime"],"summary":"Parse a date","description":"","parameters":[{"name":"date","in":"query","required":true,"description":"Date string or unix timestamp","schema":{"type":"string"},"example":"2026-05-30T12:00:00Z"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"day":30,"iso":"2026-05-30T12:00:00.000Z","hour":12,"unix":1780142400,"year":2026,"input":"2026-05-30T12:00:00Z","month":5,"minute":0,"second":0,"unix_ms":1780142400000,"weekday":6,"iso_week":22,"month_name":"May","day_of_year":150,"is_leap_year":false,"weekday_name":"Saturday"},"meta":{"timestamp":"2026-05-30T09:00:23.359Z","request_id":"0b8a4334-72f3-4900-8607-552185800c0e"},"status":"ok","message":"OK","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/unix":{"get":{"operationId":"get_v1_unix","tags":["DateTime"],"summary":"Unix <-> ISO conversion","description":"","parameters":[{"name":"timestamp","in":"query","required":false,"description":"Unix timestamp","schema":{"type":"string"},"example":"1748600000"},{"name":"date","in":"query","required":false,"description":"Date string (alternative)","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"iso":"2025-05-30T10:13:20.000Z","unix":1748600000,"input":"1748600000","unix_ms":1748600000000},"meta":{"timestamp":"2026-05-30T09:00:23.432Z","request_id":"ea1498d0-c54a-4fd2-9561-7ac6be8f810c"},"status":"ok","message":"OK","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}}},"x-oanor-pricing":[{"slug":"free","name":"Free","price_cents_month":0,"monthly_call_quota":18000,"rps_limit":5,"hard_limit":true},{"slug":"basic","name":"Basic","price_cents_month":400,"monthly_call_quota":260000,"rps_limit":15,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":1300,"monthly_call_quota":1700000,"rps_limit":40,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":3500,"monthly_call_quota":9000000,"rps_limit":120,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/datetime-api"}