{"uid":"cap_QDoGyFdhEd0sn8oLLpMb5","slug":"datetime-openverbs-com-add-duration-49a9ed43","name":"datetime.openverbs.com Add Duration","description":"Add an ISO 8601 duration to a start date or date-time and return the resulting UTC instant. Calendar-aware: months and years honor month lengths (e.g. Jan 31 + P1M clamps to the last day of February). A negative-signed duration subtracts.","url":"https://datetime.openverbs.com/v1/add","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","required":["start","duration"],"properties":{"start":{"type":"string","maxLength":64,"minLength":4,"description":"ISO 8601 date or date-time (bare dates are treated as UTC midnight)."},"duration":{"type":"string","maxLength":128,"minLength":2,"description":"ISO 8601 duration to add."}},"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_i4J5NEgqjlXTuU1RjwTko","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":"Adds (or subtracts) an ISO 8601 duration to a start date or datetime, returning the resulting UTC instant with calendar-aware handling of month/year boundaries.","exampleAgentPrompt":"What date and time do I get if I add P1Y6M (one year and six months) to 2024-01-31T00:00:00Z?","exampleUseCases":[{"title":"Subscription renewal date calculation","prompt":"My subscription started on 2024-03-31 and runs for 1 year — what exact date does it expire? Add P1Y to 2024-03-31 and tell me the resulting date."},{"title":"Project deadline offset from kickoff","prompt":"Our project kicks off on 2025-02-28 and has a 10-week timeline. What is the deadline date? Add P10W to 2025-02-28."},{"title":"Loan maturity date from disbursement","prompt":"A loan was disbursed on 2024-11-30 with a 3-month term. What is the maturity date? Add P3M to 2024-11-30, making sure to clamp to the last day of February if needed."}],"resultDescription":"Returns the resulting UTC instant after adding the specified ISO 8601 duration to the start date or datetime. Month and year arithmetic is calendar-aware (e.g., Jan 31 + P1M clamps to Feb 28/29). Negative durations subtract instead of add.","failureModes":["Invalid ISO 8601 date format in 'start' field returns a 400 error","Invalid ISO 8601 duration format in 'duration' field returns a 400 error","Date out of representable range returns an error","Missing required fields 'start' or 'duration' returns a 422 validation error","Payment not provided or insufficient funds returns a 402 error"],"whenToPreferThis":"Use this endpoint when you need calendar-correct date arithmetic — especially for month or year additions where clamping to valid month-end dates matters (e.g., Jan 31 + 1 month = Feb 28, not March 3). Prefer this over manual arithmetic or generic date libraries when the result must be a precise UTC instant from a structured ISO 8601 duration.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T00:31:37.812Z","isFirstParty":false}