Age calculator
Exact age in years, months and days, plus the next birthday, with an explicit rule for 29 February birthdays.
- Version 1
- Free, no sign-up
Result: Leap-day birthday, 1 Mar rule
| Years Completed years. |
0 |
|---|---|
| Months Completed months since the last birthday. |
0 |
| Days Days since the last whole month. |
0 |
| Total months Completed months since birth. |
0 |
| Total weeks Completed weeks since birth. |
52 |
| Total days Days since birth. |
365 |
| On date The date the age was calculated on. |
2001-02-28 |
| Next birthday Date of the next birthday. |
2001-03-01 |
| Days until next birthday Days until the next birthday. |
1 |
Calculator date/age@1.
How it is calculated
years = completed anniversaries; then months and days as in date/differenceAge on a given date as completed years, months and days. People born on 29 February reach a new age on 28 February in common years by default (the rule in New Zealand and Taiwan, and the one consistent with date arithmetic); choose mar1 for the 1 March rule used in the UK and Hong Kong.
- Dates use the Gregorian calendar (ISO 8601). Adding months clamps to the month's last day (Jan 31 + 1 month = Feb 28 or 29).
References
- ISO 8601 date and time format
- IANA Time Zone Database
- UK Family Law Reform Act 1969, s.9 (time at which a person attains an age)
Results follow each calculator's documented rules and the sources listed. They are not financial, tax or legal advice. Check that the rules fit your case before you rely on a result. See the terms.
Use it from your code
curl https://api.curatedapi.com/v1/calc/date/age \
-H "Authorization: Bearer $CURATEDAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"birth_date": "2000-02-29",
"on_date": "2001-02-28",
"leap_day_birthday": "mar1"
}'
The same call in Python
import os
import requests
payload = {
"birth_date": "2000-02-29",
"on_date": "2001-02-28",
"leap_day_birthday": "mar1",
}
response = requests.post(
"https://api.curatedapi.com/v1/calc/date/age",
headers={"Authorization": f"Bearer {os.environ['CURATEDAPI_KEY']}"},
json=payload,
timeout=10,
)
print(response.json()["result"])
The same call in JavaScript
const payload = {
"birth_date": "2000-02-29",
"on_date": "2001-02-28",
"leap_day_birthday": "mar1",
};
const response = await fetch("https://api.curatedapi.com/v1/calc/date/age", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CURATEDAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify(payload),
});
console.log((await response.json()).result);
MCP tool calc_date_age at https://mcp.curatedapi.com.
Inputs, outputs and errors in the API reference.
Put it on your website
<div data-curatedapi-widget="date/age" data-key="capi_public_…"></div>
<script src="https://widgets.curatedapi.com/v1/widget.js" async></script>
Use a public key registered for your site. Calculations are billed like API calls. How widgets work.
Related calculators
- Add or subtract time from a date
- Date difference calculator
- Public holidays by country and year
- Time zone converter
- Working days calculator with public holidays
- Working hours and SLA deadline calculator
Add this calculator to your website
Paste two lines into your page and your visitors get this calculator. Each use counts as one call on your plan, the same as the API.
Free for up to 1,000 uses a month. 50,000 uses a month cost $9.00 on the Starter plan.