{"uid":"cap_SdfIcVsSXNlN3f3Pxkn_k","slug":"agent402-tools-calendar-diff-4bcfd685","name":"agent402.tools Calendar Diff","description":"Calculate the precise difference between two datetimes in years, months, days, hours, minutes, seconds, and total milliseconds. Accepts ISO 8601, Unix timestamps, or natural date strings. ?from=2024-01-15&to=2026-06-23.","url":"https://agent402.tools/api/calendar-diff","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":["from","to"],"properties":{"to":{"type":"string","description":"End datetime"},"from":{"type":"string","description":"Start datetime"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"to":"2026-06-23T00:00:00.000Z","diff":{"days":8,"hours":0,"years":2,"months":5,"minutes":0,"seconds":0},"from":"2024-01-15T00:00:00.000Z","total":{"days":890,"hours":21360,"minutes":1281600,"seconds":76896000,"milliseconds":76896000000}}},"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_FW74aIVwOMc9K6Xz6VFR-","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":"Calculates the precise difference between two datetimes broken down into years, months, days, hours, minutes, seconds, and total milliseconds","exampleAgentPrompt":"How much time has passed between January 15, 2024 and June 23, 2026 — give me the breakdown in years, months, days, hours, and minutes?","exampleUseCases":null,"resultDescription":"A structured breakdown of the difference between the two datetimes expressed in years, months, days, hours, minutes, seconds, and total milliseconds","failureModes":["Missing 'from' or 'to' query parameter returns an error","Unparseable date string (not ISO 8601, Unix timestamp, or natural date) returns a parse error","'from' date later than 'to' date may return negative values or an error","Ambiguous natural date strings may be misinterpreted","Network timeout or service unavailability"],"whenToPreferThis":"Use this endpoint when you need a precise, multi-unit decomposition of the time difference between two specific datetimes (years + months + days + hours + minutes + seconds + milliseconds), especially when the inputs may be in mixed formats like ISO 8601, Unix timestamps, or natural language date strings. Prefer this over simple subtraction when a human-readable breakdown across calendar units is needed.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T07:00:52.885Z","isFirstParty":false}