Illustration of two calendar dates with an arrow between them showing the difference in years, months, and days

Date Difference Calculator

Pick two dates to see the difference between them. Runs entirely in your browser.


ℹ️ How this works
  • The years/months/days breakdown is calendar-aware — it simulates adding whole months from the earlier date, clamping to the last day of a shorter month (e.g. Jan 31 + 1 month lands on Feb 28/29), so it never produces a negative or nonsensical component.
  • Runs entirely client-side — nothing here is ever sent anywhere. The JSON API below is a separate, opt-in endpoint for scripts.
💻 Show API usage example (cURL)
curl -sS "https://devops.majbase.com/date-difference-calculator/api" \
    --data-urlencode 'date1=2024-01-31' \
    --data-urlencode 'date2=2024-03-01'

Returns {"years", "months", "days", "total_days", "total_weeks", "first_is_earlier", "same"}, or {"error": "..."} for an unparseable date.

🤖 Use this API as a Claude Skill

Want an AI agent (Claude Code, claude.ai, or anything else that supports the Agent Skills format) to use this tool for you on request? Download the skill below and add it:

⬇️ Download SKILL.md · View raw