Calendar converter: Gregorian to Hijri, Hebrew, Japanese era, Persian and more, plus Easter date
Calendar converter: convert a Gregorian date to other calendar systems: Islamic (both the tabular civil calendar and the Umm al-Qura variant), Hebrew, Japanese imperial era, Republic of China, Buddhist and Persian. Also computes Easter Sunday for a year in both the Gregorian and Julian reckonings. Uses the calendar support built into the runtime, with the algorithm named in every response.
Output (data): convert: gregorian, calendars {<id>: {year, month, month_name, day, era, formatted, algorithm}}, and unavailable {<id>: reason} when no to was given and a calendar is undefined for the date. Gregorian input covers years 1-9999 (proleptic Gregorian, so month and month_name always agree with the date given); every field is computed for the whole range, never clamped. A calendar that is undefined for the date is rejected with 400 INVALID_PARAM on date when named in to, and listed in unavailable when to is omitted: japanese before Meiji 1 (1868-10-23) and islamic-umalqura outside its published table (1300-1600 AH, 1882-11-12 to 2174-11-25). islamic and persian are proleptic before their epoch (year 0 and negative years, as ICU computes them). easter: year, rite, date (always the Gregorian date), gregorian_date, julian_date (eastern rite only: the date in the Julian calendar), algorithm (anonymous-gregorian|meeus-julian). islamic is the tabular civil calendar; Hebrew months are numbered from Tishri = 1.
Deterministic: identical input returns identical output, so the response is served with Cache-Control: private, max-age=31536000, immutable (the paying client may cache it indefinitely; shared caches must not, because the response is paid).
Price: $0.05 USDC per call (x402, Base). Route contract version 1.0.0. Docs: https://api.duoleads.com/docs#time-calendar
Request
- Base URL: https://api.duoleads.com
- URL: https://api.duoleads.com/v1/time/calendar
- Auth: none declared
Query parameters
convert (default) a Gregorian date, or easter for a year. Accepted: convert, easter.
Gregorian date YYYY-MM-DD. Required when op=convert. Accepted: a calendar date as YYYY-MM-DD.
Comma-separated calendar ids: islamic, islamic-umalqura, hebrew, japanese, roc, buddhist, persian. Default all. Accepted: islamic, islamic-umalqura, hebrew, japanese, roc, buddhist, persian.
Year for op=easter, 326-9999. Accepted: integer 326-9999.
Easter reckoning: western (default) or eastern. Accepted: western, eastern.
Response
Paid and settled. data is route-specific; a route that judges its input returns 200 with data.valid: false for a bad value.
Changes
No recorded changes to this operation across all 1 revision of this API.