Subject: | Daylight Savings possible error. |
Date: | Wed, 2 Feb 2011 11:36:29 +1100 |
To: | bug-Class-Date [...] rt.cpan.org |
From: | Leo Griffiths <leo.griffiths [...] npc.com.au> |
Module = Class::Date (DLUX/Class-Date-1.1.10.tar.gz)
perl, v5.8.8
Linux 2.6.9-42.0.3.EL #1 Mon Sep 25 17:14:08 EDT 2006 x86_64 x86_64 x86_64
GNU/Linux
Hi,
I think I have found an issue with the handling of the timezones when
dealing with daylight savings time (DST).
$Class::Date::DST_ADJUST=1;
$date1 = date [2010,10,3, 1,0, 0], 'Australia/Sydney';
for (1..20) {
$date1 += '15m';
foreach $date ( $date1 ){
print join(' , ', $date->string, $date->tz, $date->tzoffset,
$date->isdst );
print "\n";
}
}
So the date I have used above is the date when daylight savings comes one
and the time it switches is at 2am in the morning ( 2am becomes 3am ).
Now if you run the code above you will see that it will increment the time
however when it hits 2am it actually goes back to 1am again. I noticed this
issue as it was causing an endless loop in my code.
As an aside it seems to me that when DST_ADJUST is set true then the time
should be adjusted to be in DST however this behaviour occurs when
DST_ADJUST is false. Its is probably just the way I am thinking about it so
not very important more just a thought.
Thank you for writing this module it is really quite useful and I expect to
use it much more in the future.
Cheers