Subject: | Can't add fractional days anymore. |
Date: | Tue, 3 Feb 2015 19:21:56 +0000 |
To: | "bug-Date-Calc [...] rt.cpan.org" <bug-Date-Calc [...] rt.cpan.org> |
From: | Judd Taylor <judd.t [...] orbitalsystems.com> |
I've been using Date::Calc 5.3 forever on many system running CentOS4 or 5.
I just had to install it on a CentOS 7 system, and this required updating Date::Calc to the latest version, 6.3, with the Date-Calc-6.3-century.patch fix.
However, it seems that this new version doesn't allow adding fractional days to a date anymore. It just results in invalid object.
Previously, this worked:
my $date = Date::Calc->new( $year, 1, 1 );
$date += $self->epoch_doy();
Where epoch_doy() was a scalar with a value like 30.155, etc. This is a common format for satellite stuff where the time of day is given as a fractional day added to the day of year.
Now, I have to do this to make it work:
my $delta_secs = 86400 * $self->epoch_doy;
$date += [+0,+0,+0,+0,+0,+$delta_secs];
So when and why did this change? Is it a bug, or something else? I can't find anything about this change in the docs for Date::Calc.
I'm mostly concerned because I don't know on my other systems just how many places the calling code will have to be fixed, so I'm certain upgrading Date::Calc on those hosts will break stuff all over the place....
Thanks,
Judd
Show quoted text
____________________________
Judd Taylor
Software Engineer
Orbital Systems, Ltd.
3807 Carbon Rd.
Irving, TX 75038-3415
(972) 915-3669 x127