{"uid":"cap_uuleDbDL5PcGwUsTnH3Ja","slug":"iso-8601-duration-converter-c0d03814","name":"ISO 8601 Duration Converter","description":"Convert an ISO 8601 duration like P1DT2H30M or PT90M to seconds, minutes, hours, days and plain words, or turn seconds into a duration string","url":"https://saylorinnovations.com/api/time/iso-duration?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["duration"],"properties":{"duration":{"type":"string","description":"ISO 8601 duration such as P1DT2H30M"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string","const":"json"},"example":{"type":"object","required":["direction","total_seconds","iso"],"properties":{"iso":{"type":"string","description":"ISO 8601 duration string"},"note":{"description":"Caveat or context for reading the result"},"human":{"type":"string","description":"Duration in plain words"},"source":{"type":"string","description":"Data source the values come from"},"direction":{"type":"string","description":"Conversion direction"},"components":{"type":"object","properties":{"days":{"type":["number","null"],"description":"Number of days"},"hours":{"type":["number","null"],"description":"Whole hours"},"weeks":{"type":["number","null"],"description":"Whole weeks"},"years":{"type":["number","null"],"description":"Years covered"},"months":{"type":["number","null"],"description":"Number of months"},"minutes":{"type":["number","null"],"description":"Whole minutes"},"seconds":{"type":["number","null"],"description":"Seconds"}},"description":"Component values"},"total_days":{"type":["number","null"],"description":"Total days"},"approximate":{"type":"boolean","description":"True when years or months make the total approximate"},"total_hours":{"type":["number","null"],"description":"Total hours"},"total_minutes":{"type":["number","null"],"description":"Total minutes"},"total_seconds":{"type":"number","description":"Total seconds"}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_GFTeQgNXu4Touex7Z_GTm","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Converts ISO 8601 duration strings (e.g. P1DT2H30M) to seconds, minutes, hours, days, and plain English, or converts seconds back to an ISO duration string","exampleAgentPrompt":"Can you convert the ISO 8601 duration P1DT2H30M into total seconds, total minutes, and plain English for me?","exampleUseCases":[{"title":"Scheduling system duration parsing","prompt":"I have a calendar event with a duration field set to P1DT2H30M — can you tell me how many total hours and minutes that is, and say it in plain words?"},{"title":"Video length normalization","prompt":"Our video metadata stores lengths as ISO durations like PT1H47M22S — what is that in total seconds so I can store it numerically?"},{"title":"Seconds to ISO duration formatting","prompt":"I have a timer that ran for 5400 seconds and I need to store it as an ISO 8601 duration string — can you convert that for me?"}],"resultDescription":"Returns a JSON object with the conversion direction, total_seconds, total_minutes, total_hours, total_days, a components object breaking the duration into years/months/weeks/days/hours/minutes/seconds, a human-readable plain English description, the ISO 8601 string, an approximate boolean (true when years or months are involved), and optional notes about caveats.","failureModes":["Invalid or malformed ISO 8601 duration string returns an error","Missing required 'duration' query parameter causes a 400-level error","Durations involving years or months marked as approximate due to variable lengths","Very large durations may produce null component fields where not applicable"],"whenToPreferThis":"Use this endpoint when you need to programmatically parse or convert ISO 8601 duration strings into numeric time units or human-readable text, or when you need to serialize a number of seconds back into a standard ISO 8601 duration string. Prefer this over manual parsing logic or general-purpose date libraries when operating in a lightweight agent context without code execution.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-18T12:56:33.287Z","isFirstParty":false,"canonicalSlug":"iso-8601-duration-converter-c0d03814"}