# Is there a way to calculate an age from a birth date?

I'm using Joplin as a lightweight contacts manager. I store each contact's "birth date" and "age". But I have to update manually the age every year. Is there a magic trick to update the age automatically ?

Maybe this plugin would help: Plugin: Math Mode

Well,

My solution is to use Google contacts. This is not the correct app for that.

Here’s a step-by-step process:

Get the Current Date: Use the current date for the calculation.
Extract Year, Month, and Day: From both the current date and the birth date, extract the year, month, and day.
Calculate the Difference: Subtract the birth year from the current year to get the initial age. Then, check if the current month and day are before the birth month and day. If so, subtract one year from the initial age.
Example Calculation
If today’s date is July 15, 2024, and the birth date is March 10, 1990:

Initial Age: 2024 - 1990 = 34 years
Adjust for Current Month and Day: Since July 15 is after March 10, the full 34 years have passed.
Therefore, the age is 34.

Nice.

The problem is that it's not automated like @chentao wants. Only a calendar program that's designed to track birthdays is going to do it automatically.

@chentao , What operating system are you using?
There are Android apps, and Windows apps just to track birthdays.
Take a look at Android "Birthday Calendar"