Age in Years and Days
I'm looking for a way to display the ages of a person in Years and Days. EX: someone born January 26, 1934 is 89 years and 149 days. How would this be calculated in Javascript? Thanks, John I can calculate it in years, months and days. just don't know how for it to be just years and days. function getAge(date_1, date_2) { //convert to UTC var date2_UTC = new Date(Date.UTC(date_2.getUTCFullYear(), date_2.getUTCMonth(), date_2.getUTCDate())); var date1_UTC = new Date(Date.UTC(date_1.getUTCFullYear(), date_1.getUTCMonth(), date_1.getUTCDate())); var yAppendix, mAppendix, dAppendix; //------------
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.