Subject: | Parsing date within a DST back switch is not consistent across timezones |
Thanks a lot for this very nice module which is essentially the heart of Schedule::Cron.
Recently, we run across a bug which happens during DST changes where the hour is
rewinded.
It is of course ambigous to parse a date within a DST back switch since this date occurs
twice. But Time::ParseDate should be consistent insofar to return always the first *or* second
entry for any timezone. The attachted example shows, that for MET the second occurence of
this date spec is used, whereas for PST8PDT the first one is used:
Running
use Time::ParseDate;
$ENV{TZ} = "MET";
my $t = parsedate("+ 1 hour",NOW => parsedate("2009-10-25 02:55:00"));
print scalar(localtime($t)),"\n";
$ENV{TZ} = "PST8PDT";
my $t = parsedate("+ 1 hour",NOW => parsedate("2009-11-01 01:55:00"));
print scalar(localtime($t)),"\n";
yields
Sun Oct 25 03:55:00 2009
Sun Nov 1 01:55:00 2009
For me it is important to get a consistent behaviour across time zones, maybe an additional
construction parameter would be helpful as well.
Subject: | dst.pl |
use Time::ParseDate;
$ENV{TZ} = "MET";
my $t = parsedate("+ 1 hour",NOW => parsedate("2009-10-25 02:55:00"));
print scalar(localtime($t)),"\n";
$ENV{TZ} = "PST8PDT";
my $t = parsedate("+ 1 hour",NOW => parsedate("2009-11-01 01:55:00"));
print scalar(localtime($t)),"\n";