For instance, the actual age it should return is 47… using this code it returns me 48. Am i doing the right way of applying the logic and calculating the age in days, months and year.
For instance, the actual age it should return is 47… using this code it
Share
Assumption that 12 months times 30 days is a year – that’s what’s most wrong in here (that’s 360 days, while in fact 1 year is close to 365.25 days on average).
What you should be doing, is calculating each segment separately: