Skip Menu |

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

Report information
The Basics
Id: 38371
Status: resolved
Worked: 15 min
Priority: 0/
Queue: Class-Date

People
Owner: dlux [...] dlux.hu
Requestors: kzhinko [...] gmail.com
Cc:
AdminCc:

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



Subject: Mythical bug
Hi, all! I got very strange results while executing following code: [code] use strict; use Class::Date; my $date = new Class::Date [2007, 3, 25, 1, 0, 0]; print "$date\n"; $date += new Class::Date::Rel '1h'; print "$date\n"; $date += new Class::Date::Rel '2h'; print "$date\n"; $date = new Class::Date [2007, 3, 25, 2, 0, 0]; print "$date\n"; $date = new Class::Date [2007, 3, 25, 3, 0, 0]; print "$date\n"; $date -= new Class::Date::Rel '1h'; print "$date\n"; $date -= new Class::Date::Rel '2h'; print "$date\n"; [/code] expected: 2007-03-25 01:00:00 2007-03-25 02:00:00 2007-03-25 04:00:00 2007-03-25 02:00:00 2007-03-25 03:00:00 2007-03-25 02:00:00 2007-03-25 00:00:00 got: 2007-03-25 01:00:00 2007-03-25 01:00:00 2007-03-25 03:00:00 2007-03-25 03:00:00 2007-03-25 03:00:00 2007-03-25 03:00:00 2007-03-25 01:00:00 Look, that everything is OK when we use some other date (Marth, 24th for example). I don't know why is it so.
Hi, Hmmm. Strange bug. It seems that the DST adjustment is buggy (see the DST_ADJUST in code)... Thanks for the report! In case you have time to investigate, please do and send a patch, currently I don't have the time to fix that... dLux On Sun Aug 10 11:00:34 2008, http://tit-gp.livejournal.com/ wrote: Show quoted text
> Hi, all! > > I got very strange results while executing following code: > > [code] > use strict; > use Class::Date; > > my $date = new Class::Date [2007, 3, 25, 1, 0, 0]; > print "$date\n"; > $date += new Class::Date::Rel '1h'; > print "$date\n"; > $date += new Class::Date::Rel '2h'; > print "$date\n"; > $date = new Class::Date [2007, 3, 25, 2, 0, 0]; > print "$date\n"; > $date = new Class::Date [2007, 3, 25, 3, 0, 0]; > print "$date\n"; > $date -= new Class::Date::Rel '1h'; > print "$date\n"; > $date -= new Class::Date::Rel '2h'; > print "$date\n"; > [/code] > > expected: > 2007-03-25 01:00:00 > 2007-03-25 02:00:00 > 2007-03-25 04:00:00 > 2007-03-25 02:00:00 > 2007-03-25 03:00:00 > 2007-03-25 02:00:00 > 2007-03-25 00:00:00 > > got: > 2007-03-25 01:00:00 > 2007-03-25 01:00:00 > 2007-03-25 03:00:00 > 2007-03-25 03:00:00 > 2007-03-25 03:00:00 > 2007-03-25 03:00:00 > 2007-03-25 01:00:00 > > Look, that everything is OK when we use some other date (Marth, 24th for > example). I don't know why is it so.
Thanks for fast answer! Ok, I'll try to fix it later.
Hi, Is there any news on that? Balázs On Sun Aug 10 14:28:10 2008, http://tit-gp.livejournal.com/ wrote: Show quoted text
> Thanks for fast answer! > > Ok, I'll try to fix it later.