{"uid":"cap_OafTX53Qmtwk_a3o514M4","slug":"iso-8601-duration-string-formatter-5ea61208","name":"ISO 8601 Duration String Formatter","description":"Assemble an ISO 8601 duration string from individual components (years, months, weeks, days, hours, minutes, seconds) and an optional sign. All components must be non-negative and at least one must be non-zero.","url":"https://datetime.openverbs.com/v1/format","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"type":"object","properties":{"days":{"type":"number","minimum":0,"description":"Days."},"sign":{"enum":[1,-1],"type":"integer","description":"Overall sign. Default 1."},"hours":{"type":"number","minimum":0,"description":"Hours."},"weeks":{"type":"number","minimum":0,"description":"Weeks."},"years":{"type":"number","minimum":0,"description":"Years."},"months":{"type":"number","minimum":0,"description":"Months."},"minutes":{"type":"number","minimum":0,"description":"Minutes."},"seconds":{"type":"number","minimum":0,"description":"Seconds."}},"additionalProperties":false},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","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.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm__5VP2KkN7MOBN8PmYQ0Ib","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Assembles a valid ISO 8601 duration string (e.g. P1Y2M10DT2H30M) from individual numeric components (years, months, weeks, days, hours, minutes, seconds) and an optional sign.","exampleAgentPrompt":"Build me an ISO 8601 duration string for 1 year, 2 months, 10 days, 2 hours, and 30 minutes.","exampleUseCases":[{"title":"Scheduling recurring event intervals","prompt":"I need to set a recurring event that repeats every 1 year and 6 months — can you give me the ISO 8601 duration string for that interval?"},{"title":"Encoding negative time offset for API","prompt":"I need a negative ISO 8601 duration string representing minus 3 hours and 45 minutes to pass to a scheduling service."},{"title":"Expressing project timeline as ISO duration","prompt":"Our project spans 2 years, 4 months, and 15 days — can you format that as a proper ISO 8601 duration string?"}],"resultDescription":"Returns a valid ISO 8601 duration string (e.g. 'P1Y2M10DT2H30M') constructed from the supplied component values, respecting the overall sign (positive or negative). The string can be used directly in calendar APIs, scheduling systems, or any standard ISO 8601 duration-aware service.","failureModes":["All components are zero — at least one must be non-zero","Negative component values provided — all components must be non-negative","Invalid sign value — must be 1 or -1","Missing required body fields — request rejected with validation error","Malformed JSON body — parse error returned"],"whenToPreferThis":"Choose this endpoint when you have individual numeric time components (years, months, weeks, days, hours, minutes, seconds) and need to produce a standards-compliant ISO 8601 duration string. Prefer it over manual string concatenation to avoid formatting errors, especially when dealing with optional components or negative durations. It complements the sibling parse endpoint when you need round-trip duration handling.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T00:40:00.639Z","isFirstParty":false}