The both functions return the age after the birthday has passed, regardless whether it has actually passed or not. So unless a person is born on first of january, the implementations return a incorrect result for some part of the current year.
Thank you for pointing that out. I wanted to keep it simple and just get the age, but it turns out it's not accurate. Could you recommend a better function, one that returns YY-MM-DD-HH-SS?
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
The both functions return the age after the birthday has passed, regardless whether it has actually passed or not. So unless a person is born on first of january, the implementations return a incorrect result for some part of the current year.
Thank you for pointing that out. I wanted to keep it simple and just get the age, but it turns out it's not accurate. Could you recommend a better function, one that returns YY-MM-DD-HH-SS?