The Age Calculator can determine the age or interval between two dates. The calculated age will be displayed in years, months, weeks, days, hours, minutes, and seconds.
Note: The age of a person can be counted differently in different cultures. This calculator uses the most common age system where age increases on a person's birthday.
In this system, the age of a person who has lived for 3 years and 11 months is 3, and their age will increase to 4 on their next birthday one month later. Most western countries use this age system.
In some cultures, age is expressed by counting years with or without including the current year. For example, a person who is twenty years old is the same age as another person who is in their twenty-first year of life.
In one of the traditional Chinese age systems, people are born at age 1 and their age increases at the Traditional Chinese New Year rather than their birthday.
Calculation method: We count from a specific date to the same date in the next month as one month (e.g., Feb. 20 to Mar. 20 is one month). For dates at month ends, we count from the last day of the month to the last day of the next month as one month (e.g., Feb. 28 to Mar. 31 is one month).
For those curious about the underlying process, here's how our calculator determines your age:
birthDate is the user's date of birth (e.g., YYYY-MM-DD).currentDate is today's date (or the date you want to calculate the age at).years = 0months = 0days = 0Start by subtracting the birthDate year from the currentDate year.
years = currentDate.getFullYear() - birthDate.getFullYear()
If currentDate's month is less than birthDate's month,
OR if currentDate's month is equal to birthDate's month AND currentDate's day is less than birthDate's day,
THEN years = years - 1.
This is the trickier part, as we need to account for varying days in months.
We effectively set the birthDate's year to currentDate's year to simplify month/day comparison.
currentDate's day is less than the birthDate's day:
birthDate's day, then add currentDate's day.currentDate's month.currentDate's month is less than the birthDate's month:
currentDate's month.months = currentDate.getMonth() - birthDate.getMonth()
days = currentDate.getDate() - birthDate.getDate()