I'm trying to figure out a way to calculate the year of birth for records when it is given the age of up to two decimal places on a specific date - in Perl.
To illustrate this example, consider these two entries:
date, age at date
25 Nov 2005, 74.23
21 Jan 2007, 75.38
What I want to do is get the year of birth based on these records - it should be, theoretically, consistent. The problem is that when I try to get it by calculating the difference between the year in the date field minus age, I encounter rounding errors, as a result of which the results look wrong, while they are actually correct.
I tried to use some kind of smart combination of int () or sprintf () to round, but not use. I looked at Date :: Calc but can't see what I can use.
ps Like many dates before 1970, I cannot, unfortunately, use the UNIX era for this.
source
share