South Star

ISO 8601 Duration Converter Parse Format Dates Timezones API

Free tier included · Tools
Parse ISO durations, format seconds, calculate age, business days, convert timezones, and manage dates.

ISO 8601 Duration Converter is a comprehensive date and time toolkit that goes beyond simple duration parsing. Recently expanded with powerful new endpoints, it now covers everything the leading date-and-time APIs offer — at a fraction of the cost. In addition to parsing complex ISO 8601 duration strings (like `P3Y6M4DT12H30M5S`) into components and total seconds, and building normalized ISO strings, the API handles date arithmetic, age calculations, business day counting, calendar grid generation, and IANA timezone conversions.

Whether you are building subscription billing engines, scheduling tools, ETL pipelines, or calendar apps, you can calculate exact age from birth dates, count business days excluding weekends, generate date ranges, convert Unix timestamps, and shift datetimes across global timezones.

The service is completely offline and stateless, making it fast and privacy-friendly. For duration conversions, year lengths use the standard Julian convention (1 year = 31,557,600s, 1 month = 2,629,746s). Input strings are validated against strict length and character limits (e.g. durations max 64 characters) to prevent overflow or injection issues. Errors return structured validation details, ensuring your integrations fail safely and predictably.

Endpoints

MethodPathWhat it does
GET/API metadata and root discovery endpoint.
GET/healthLiveness probe returning health status.
POST/parseParse an ISO 8601 duration string into components and total seconds.
POST/to-durationBuild a normalized ISO 8601 duration string from total seconds or components.
POST/parse-dateParse a date or datetime string in a common format into its components.
POST/add-durationAdd an ISO 8601 duration to a date and return the resulting datetime.
POST/subtract-durationSubtract an ISO 8601 duration from a date and return the resulting datetime.
POST/convert-timezoneConvert a datetime string from one IANA timezone to another.
GET/timezonesList all available IANA timezone names from the system database.
POST/unix-to-dateConvert a Unix timestamp to a UTC datetime string.
POST/date-to-unixConvert a date or datetime string to a Unix timestamp.
POST/ageCalculate exact age in years, months, and days from a birth date.
POST/date-rangeGenerate an array of dates between a start and end date with a given step.
GET/calendarGenerate a calendar grid for a specific year and month with weekday info.
POST/business-daysCount business days (Monday to Friday) between two dates.

Quick start

curl -X POST "https://duration.p.rapidapi.com/parse" \
  -H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \
  -H "X-RapidAPI-Host: duration.p.rapidapi.com" \
  -H "Content-Type: application/json" \
  -d '{"duration":"P3Y6M4DT12H30M5S"}'

FAQ

How are duration years and months converted to seconds?

Because calendar months and years have variable lengths, total seconds use the standard Julian convention: 1 year = 31,557,600 seconds (365.25 days) and 1 month = 2,629,746 seconds.

Are timezones fully supported for conversions?

Yes. The `/convert-timezone` and `/timezones` endpoints leverage standard IANA timezone names backed by the system's timezone database.

What happens if I provide an invalid duration string or malformed date?

The API returns a structured validation error response with HTTP 422, detailing exactly which parameter failed validation.

Is my data logged or stored anywhere?

No. The API is completely stateless and offline. No request payloads, dates, or durations are stored or logged.

Try ISO 8601 Duration Converter Parse Format Dates Timezones free

Free tier on every plan. Get an API key and start calling in under a minute.

Open on RapidAPI

Related APIs