{"uid":"cap_9Oge3J4GhAh_i81wnf7z-","slug":"x402-utils-date-arithmetic-difference-calculator-d8790bb7","name":"x402 Utils – Date Arithmetic & Difference Calculator","description":"Add or subtract an ISO 8601 duration (P1M, P2W, PT36H) to a date, months clamped to the month's end; or count the days, weeks, calendar months, years, seconds and business days (Monday to Friday, less a country's public holidays) between two dates. Also the weekday, ISO week and day of year.","url":"https://utils.kagurazaka.dev/v1/date?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":["start"],"properties":{"add":{"type":"string","description":"an ISO 8601 duration to add, such as P1M10D"},"end":{"type":"string","description":"a second date, to count the time between"},"start":{"type":"string","description":"a date such as 2026-10-25, or an ISO 8601 time"},"country":{"type":"string","description":"ISO country code whose public holidays are not business days, such as JP"},"subtract":{"type":"string","description":"an ISO 8601 duration to subtract"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"start":{},"between":{}}}}}}},"responseSchema":{"type":"json","example":{"start":{"date":"2026-10-25","weekday":"Sunday","iso_week":43},"between":{"days":61,"months":2,"business_days":42}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","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.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_DdXm4nKqRIVr9b11YZhp-","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Add or subtract ISO 8601 durations to a date, or compute the difference between two dates in days, weeks, months, years, seconds, and business days (with country-specific public holidays).","exampleAgentPrompt":"How many business days are there between 2025-03-01 and 2025-06-30 in the US, and what weekday and ISO week number does June 30 fall on?","exampleUseCases":[{"title":"Project deadline date calculation","prompt":"Our contract starts on 2025-09-01 — what date is exactly 3 months and 10 days later, and what day of the week does that land on?"},{"title":"Business days countdown for payroll","prompt":"How many business days are there between 2025-07-15 and 2025-08-15 in Japan, excluding Japanese public holidays?"},{"title":"Age or tenure in multiple units","prompt":"How many days, weeks, calendar months, and years are there between 1990-04-22 and 2025-04-22?"}],"resultDescription":"A JSON object with a 'start' section (date string, weekday name, ISO week number, and day of year) and optionally a 'between' section (days, weeks, months, years, seconds, and business days between the start and end dates).","failureModes":["Missing required 'start' parameter returns an error","Invalid date format (non-ISO 8601) causes a parse error","Invalid ISO 8601 duration string (e.g. malformed 'P' expression) causes an error","Unrecognized ISO country code may result in no holiday exclusions or an error","Both 'add' and 'subtract' specified simultaneously may cause ambiguous behavior"],"whenToPreferThis":"Choose this endpoint when you need precise calendar arithmetic — adding or subtracting ISO 8601 durations with correct month-end clamping, or counting elapsed time between two dates in multiple units including country-specific business days. Prefer it over generic date libraries when you need business-day counting with public holidays for a specific country, or when you need ISO week numbers and weekday metadata alongside the result.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-30T07:06:30.574Z","isFirstParty":false,"canonicalSlug":"x402-utils-date-arithmetic-difference-calculator-d8790bb7"}