I want to calculate the age of a person given the date of birth and the current date in years, months and days relative to the current date.
For example:
<
That is not an easy question, since above days (if we don't take into account leap-seconds) there are not easy formulas.
Months can consist of 28, 29, 30, or 31 days; years can be 365 or 366 days. Therefore, problems arise when you try to calculate full units of time for months and years.
Here is an interesting article that takes into account all the complex aspects to solve your question in Java.