calculate_date
Get the current date and time, or do calendar math exactly, DST-aware. action=now: the current time in tz. action=add: shifts date by the add object, e.g. {"months": 1} or {"business_days": 10}; month ends are clamped (Jan 31 + 1 month = Feb 28). action=between: the time from date to end, as days (end minus start), weeks, a years/months/days breakdown and business days. Business days are Monday to Friday counted after the start day, with no holidays. If end is earlier, the numbers are negative and the result says "direction": "backward". action=info: weekday, week number and quarter of date, converted to to_tz if given. A date with its own offset keeps it; others are read in tz. Use this instead of guessing today's date or counting days yourself; use calculate_expression for plain numbers. Dates in almost any format are accepted; ambiguous ones like 03/04/2026 are read month-first unless dayfirst=true, and notes say how input was read. Missing or unreadable inputs return an error naming the parameter.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tz | No | now: the zone to answer in. Others: the zone of dates that don't state one. IANA ("Asia/Tokyo"), offset or abbreviation. Default UTC. | |
| add | No | add (required): years, months, weeks, days, hours, minutes, seconds or business_days; negative to subtract. | |
| end | No | between: the end date (required). | |
| date | No | add, between (start), info: required. e.g. "2026-10-07" or "Oct 7 2026 9am". | |
| to_tz | No | info: convert to this zone. | |
| action | Yes | ||
| dayfirst | No | Read 03/04/2026 as 3 April. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| notes | No | How an ambiguous input was read. | |
| value | Yes | now/add/info: iso, date, weekday, time, tz, utc_offset, iso_week, quarter. between: days, weeks, breakdown, business_days, direction (forward or backward). |