{"uid":"cap_2VbRwIfTc5ZHZEsoeDbAf","slug":"agishub-date-calculate-86a34181","name":"AGISHub Date Calculate","description":"Timezone-aware date arithmetic: add or subtract a duration to a datetime (days are calendar-based and DST-safe; hours and minutes are absolute), or compute the difference between two datetimes that may be in different zones.","url":"https://api.agishub.com/paid/date-calculate","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input","output"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"type":"object","required":["datetime","timezone","operation"],"properties":{"datetime":{"type":"string","description":"Base datetime: ISO 8601 or natural language."},"timezone":{"type":"string","description":"IANA timezone the base datetime is in."},"operation":{"type":"object","required":["type"],"properties":{"type":{"enum":["add","diff"],"type":"string","description":"'add' to shift the datetime by a duration, or 'diff' to measure the gap between two datetimes."},"unit":{"enum":["seconds","minutes","hours","days","weeks"],"type":"string","description":"For type 'add': one of seconds, minutes, hours, days, weeks."},"amount":{"type":"number","description":"For type 'add': how much to shift. Use a negative number to subtract."},"to_datetime":{"type":"string","description":"For type 'diff': the second datetime (ISO 8601 or natural language)."},"to_timezone":{"type":"string","description":"For type 'diff': the IANA timezone of to_datetime (defaults to the base timezone)."}},"description":"What to compute: { type:'add', amount, unit } to add/subtract a duration, or { type:'diff', to_datetime, to_timezone? } for the difference between two datetimes.","additionalProperties":false}},"additionalProperties":false},"type":{"enum":["http"],"type":"string"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json"],"type":"string"}},"additionalProperties":false},"output":{"type":"object","required":["type","example"],"properties":{"type":{"enum":["json"],"type":"string"},"example":{"type":"object"}},"additionalProperties":false}}},"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_vyRsdA4Tczi7bdn07rx76","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":"Performs timezone-aware date arithmetic: add or subtract a duration from a datetime, or compute the difference between two datetimes across different timezones with DST-safe calendar math.","exampleAgentPrompt":"What date and time will it be 45 days from now starting from March 1, 2025 at 9am America/New_York time? Use calendar-day math so DST changes are handled correctly.","exampleUseCases":[{"title":"Contract deadline calculation","prompt":"My contract starts on April 1, 2025 at noon in London — what is the exact date and time 90 days later, using calendar days so DST is handled correctly?"},{"title":"Cross-timezone elapsed time","prompt":"How many hours are there between January 15, 2025 at 8am in America/Los_Angeles and January 16, 2025 at 6pm in Europe/Berlin?"},{"title":"Countdown to event","prompt":"I need to subtract 2 weeks from my event date of December 25, 2025 at 10am in Asia/Tokyo — what datetime does that land on?"}],"resultDescription":"A JSON object containing the computed result: for 'add' operations, the resulting datetime (ISO 8601) in the original timezone accounting for DST transitions; for 'diff' operations, the numeric difference between the two datetimes expressed in a meaningful unit (e.g. total seconds, minutes, hours, or days).","failureModes":["Invalid or unrecognizable datetime string — returns error if natural language cannot be parsed","Unknown IANA timezone identifier — returns error with message about unrecognized timezone","Missing required operation parameters (e.g. 'add' without amount/unit, 'diff' without to_datetime) — returns validation error","Out-of-range or malformed amount values — may return error or unexpected result","Payment failure or insufficient balance — HTTP 402 response requiring x402 payment"],"whenToPreferThis":"Choose this endpoint when you need reliable, DST-aware calendar date arithmetic or cross-timezone datetime differencing. It handles the edge cases of daylight saving transitions correctly (days are calendar-based, not always 24-hour periods) and accepts natural language datetimes alongside ISO 8601 strings. Prefer it over client-side date math when DST correctness, cross-timezone accuracy, or auditability matter.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T00:47:06.176Z","isFirstParty":false}