Date math
Date calculations in one pass: difference between two dates, add time to a date, and compute age from a birthdate.
When to use this pack
An agent needs to answer date questions: how many days between two events, what date is 30 days from now, how old is someone. Common in scheduling, contract management, and user-profile logic.
Tools in this pack
-
Date difference
$0.001
POST /api/date-diff
Difference between two dates/times in ms, seconds, minutes, hours, days, and a human summary.
-
Date arithmetic
$0.001
POST /api/add-time
Add (or subtract) a duration to a date. duration like "2d", "-3h", "1w 2d", "90m". Returns the resulting UTC ISO timestamp.
-
Age calculator
$0.001
POST /api/age
Compute a precise age (years, months, days) from a birth date to today (or a given date), plus total days.
Workflow
- Compute the difference between the two dates with date-diff — returns days, hours, minutes, and a human-readable string.
- Add 30 days to the start date with add-time — demonstrates forward-projection from an anchor date.
- Compute age from the start date as a birthdate with age — returns years, months, days.
Run it in Claude
claude mcp add agent402 -s user -- npx -y agent402-mcp@latest
Then paste this prompt into Claude:
Run date math using Agent402: (1) date-diff {from:"2024-01-01", to:"2026-07-04"} — get difference. (2) add-time {date:"2024-01-01", amount:30, unit:"days"} — project forward. (3) age {birthdate:"2024-01-01"} — compute age. Return all three.
← All skill packs