Subject: | bad results |
Date: | Thu, 18 Dec 2008 10:11:25 -0800 |
To: | <bug-Class-Date [...] rt.cpan.org> |
From: | "Gina Mariposa" <maripogi [...] LStream.org> |
I've encountered this problem using Class::Date
Here's my code:
#!/usr/bin/perl
#
# play2.pl
#
use Class::Date;
my $d2 = Class::Date->new('1935-12-23');
my $d1 = Class::Date->new('2008-12-17');
my $k = (Class::Date->new($d1)-$d2)->year;
print "\n$d2";
print "\n$k";
exit;
When $d2 is "1935-12-24", the correct value is returned. :-) Any date
older than 1935-12-24 is not correct. Of course, I say that having
tried only a few dates before 1935-12-24!
I' needing the donor's age in years... so I'm pretty sure I can get by
with adding 30 years to the birthdate year ("1965-12-23"), and the 44
return value can then be increased to 74.
Thanks for your help. I have enjoyed using Class::Date in several
programs.
Gina Mariposa
Senior Programmer Analyst
LifeStream
The new name for the Blood Bank of San Bernardino and Riverside Counties
384 West Orange Show Road
San Bernardino, CA 92408
Office: 909.386.6824
Fax: 909.383.9223
www.LStream.org
gmariposa@LStream.org
We help save lives by connecting donors and patients through the gift of
blood...give blood today!