Duration API
Work with ISO-8601 durations — the PnYnMnDTnHnMnS strings (P3Y6M4DT12H30M5S, PT1H30M) used across calendars, scheduling, video metadata, billing periods and APIs. Parse a duration into its components and a total in seconds and milliseconds; format a number of seconds (or individual year/month/week/day/hour/minute/second fields) back into a canonical ISO-8601 string; humanise any duration into readable text ("1 hour and 30 minutes"); and measure the exact duration between two instants (ISO timestamps or unix epochs) as both an ISO-8601 string and a precise second count. Years and months use documented calendar averages and are clearly flagged as approximate. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 5 endpoints. Distinct from date/time parsing and relative-time ("3 hours ago") formatting.
api.oanor.com/duration-api