CC: | <morten_bjoernsvik [...] yahoo.no> |
Subject: | Invalid DST dates produces lots of errors on perl 5.10.0 or higher |
Date: | Wed, 23 Mar 2011 14:42:51 +0100 |
To: | <bug-Date-Manip [...] rt.cpan.org> |
From: | Morten Bjørnsvik <morten.bjornsvik [...] experian-da.no> |
Hi all
I've just moved our app to perl5.12.2 from perl 5.8.9
We work mainly in 'Europe/Oslo' timezone.
When DST changes from winter to summer we add 1hour.
Then there is a gap where datetime is invalid.
'2010032802:20:52' in timezone 'Europe/Oslo' is such a
date.
This is fine in perl 5.8.9.
[mbj@mortenb5 t]$ /opt/perl/bin/perl Date-Manip-622.t
# Date::Manip version:6.22
# Current Timezone:Europe/Oslo
Use of uninitialized value $y in concatenation (.) or string at /opt/perl/lib/site_perl/5.12.2/Date/Manip/Base.pm line 1813.
Use of uninitialized value $m in concatenation (.) or string at /opt/perl/lib/site_perl/5.12.2/Date/Manip/Base.pm line 1820.
Use of uninitialized value $d in concatenation (.) or string at /opt/perl/lib/site_perl/5.12.2/Date/Manip/Base.pm line 1820.
Use of uninitialized value $h in concatenation (.) or string at /opt/perl/lib/site_perl/5.12.2/Date/Manip/Base.pm line 1820.
Use of uninitialized value $mn in concatenation (.) or string at /opt/perl/lib/site_perl/5.12.2/Date/Manip/Base.pm line 1820.
Use of uninitialized value $s in concatenation (.) or string at /opt/perl/lib/site_perl/5.12.2/Date/Manip/Base.pm line 1820.
Use of uninitialized value $beg in string comparison (cmp) at /opt/perl/lib/site_perl/5.12.2/Date/Manip/TZ.pm line 1078.
Use of uninitialized value $end in string comparison (cmp) at /opt/perl/lib/site_perl/5.12.2/Date/Manip/TZ.pm line 1080.
Use of uninitialized value $year in addition (+) at /opt/perl/lib/site_perl/5.12.2/Date/Manip/TZ.pm line 1081.
# '2010032802:20:52' not supported
If I run this on a perl 5.8.9 then there is no errors:
( I need to comment out the TZ_base.pm part because it requires perl5.10)
mbj@mortenb2:/opt/s3/server/t> /opt/perl/bin/perl ./Date-Manip-622.t
# Date::Manip version:6.22
# '2010032802:20:52' not supported
use warnings;
use strict;
use Test::More;
use Date::Manip;
diag( "Date::Manip version:" . $Date::Manip::VERSION );
$Date::Manip::Backend = 'DM5';
use Date::Manip::TZ;
my $tz = new Date::Manip::TZ;
diag( "Current Timezone:" . $tz->curr_zone() );
foreach my $dstring ( q(2010032802:20:52) ) {
my $t = Date::Manip::ParseDate($dstring);
if ( UNIVERSAL::isa($t, q(Date::Manip))) {
ok(1,"'$dstring' supported:");
}
else {
diag("'$dstring' not supported");
}
}
--
----------------------------------------------------------------
Morten Bjørnsvik, Experian Decision Analytics AS
Sørkedalsveien 10c, Postbox 5275 Majorstua, 0303 Oslo, Norway
Mob: +47 92 44 83 02, Dir: +47 21 52 12 65, Fax: +47 21 52 12 51
----------------------------------------------------------------