Age calculator app

Solution retrospective
*Hi there
I had many problems with this project. I do not know how to calculate age, and I faced issues with logic. Please, can anyone help me?
Please log in to post a comment
Log in with GitHubCommunity feedback
- @LouMauriege
Hi! You made a pretty good job yet.
To calculate difference between two dates you can create two dates and subtract them.
You create the variable date on script.js.line.16, you can create another on with the input values that the user gives you. Then you can subtract those dates, and you'll have the difference between those two dates in milliseconds. After that you just had to divide, this result with the number of milliseconds in one year and the result of it should be the years between your two dates. Then take the modulo of this division and divide it with the numbers of milliseconds in one month and so on till you get the years, month and days between your two dates.
Hope it will help you :)
Marked as helpful
Join our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord