← Home

datetime

Deterministic date and time arithmetic for AI agents.

Date math is deceptively hard. Leap years, month boundaries, business day exclusions, timezone-adjacent edge cases. Agents will confidently say '90 days from March 1 is May 30' without checking whether it's a leap year. Euclid's datetime tool computes exact calendar results so your agent never gets a deadline, age, or duration wrong.


Live

euclid / datetime
datetime("add", { date: "2026-03-15", amount: 90, unit: "days" }){ "result": "2026-06-13" }
datetime("difference", { from: "2022-06-01", to: "2026-03-21" }){ "result": "1389 days", "years": 3, "months": 9, "days": 20 }
datetime("business_days", { from: "2026-03-16", to: "2026-03-28" }){ "result": "10 business days" }
datetime("age", { birthDate: "1988-11-22", asOf: "2026-03-21" }){ "result": "37 years" }

Operations

differenceaddsubtractbusiness_daysdays_in_monthagequarterday_of_weekis_leap_year

Examples

What it looks like in practice

Contract deadline calculation

datetime("add", { date: "2026-03-15", amount: 90, unit: "days" })

{ "result": "2026-06-13" }

Employee tenure for benefits eligibility

datetime("difference", { from: "2022-06-01", to: "2026-03-21" })

{ "result": "1389 days", "years": 3, "months": 9, "days": 20 }

SLA business day countdown

datetime("business_days", { from: "2026-03-16", to: "2026-03-28" })

{ "result": "10 business days" }

Patient age verification for a clinical trial

datetime("age", { birthDate: "1988-11-22", asOf: "2026-03-21" })

{ "result": "37 years" }

Fiscal quarter assignment for a transaction

datetime("quarter", { date: "2026-08-15" })

{ "result": "Q3" }

Payroll schedule alignment

datetime("day_of_week", { date: "2026-12-25" })

{ "result": "Friday" }


Who uses this

Built for agents across every domain

fn()

Legal assistant

An AI agent computing statute of limitations deadlines where one day wrong means a case is time-barred.

fn()

HR manager

Calculating employee probation end dates, leave accruals, and benefits eligibility windows across a 500-person company.

fn()

Project manager

An agent building a Gantt chart that accounts for weekends, public holidays, and team availability.

fn()

Insurance underwriter

Computing exact ages at policy inception. A 49-year-old and a 50-year-old pay different premiums.

fn()

Event planner

An AI assistant figuring out that a '6-week lead time' from April 15 lands on a bank holiday weekend.

fn()

Accountant

Determining which fiscal quarter a transaction falls in for accurate revenue recognition.


Try datetime on Euclid Cloud

One MCP connection. Every computation your agents need.

Get started