Skip Menu |

This queue is for tickets about the Date-Calc CPAN distribution.

Report information
The Basics
Id: 101912
Status: open
Priority: 0/
Queue: Date-Calc

People
Owner: Nobody in particular
Requestors: judd.t [...] orbitalsystems.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



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
On Tue Feb 03 14:22:08 2015, judd.t@orbitalsystems.com wrote: Show quoted text
> 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 > > ____________________________ > Judd Taylor > Software Engineer > > Orbital Systems, Ltd. > 3807 Carbon Rd. > Irving, TX 75038-3415 > > (972) 915-3669 x127
Date::Calc 5.3 is still available from my website (in fact ALL versions are still available there, from the very beginning!): http://guest.engelschall.com/~sb/download/table.html Or does Date::Calc 5.3 fail with a new version of Perl you are using on your new machine? In that case your workaround is probably the best way to go, indeed.