
27 Jun
2006
27 Jun
'06
8:15 p.m.
Paul Giaccone
A person born on 1 January 2003 is 365 days old on their first birthday, while someone born on 1 January 2004 is 366 days old on their first birthday. On their first birthdays, each of them is a year old, but the second person is a day older than the first. So simply dividing by 365 and using the remainder for the days in the part-year would not be sufficient.
There is a perl module called Date::Manip that has some ideas on how to deal with date differences. You can browse the documentation at cpan.org. Look for the DateCalc function.