Bug#665809: libdate-manip-perl: ParseDate breaks on non-existing times during DST change

gregor herrmann gregoa at debian.org
Tue Mar 27 17:24:28 UTC 2012


On Mon, 26 Mar 2012 12:57:23 +0200, Andy Spiegl wrote:

> Date::Manip does not handle the case correctly where a specified time
> lies in a non-existing gap, e.g. here in Germany between 2am and 3am
> when the time is skipping one hour.
> 
> Try this to reproduce the bug:
> 
> ---8<----8<-----8<-----8<-----8<-----8<-----8<---
> #!/usr/bin/perl
> 
> use strict; use warnings;
> 
> use Date::Manip;
> 
> &Date_Init();
> 
> my $d = ParseDate("2012-03-25 at 02:11");
> 
> ---8<----8<-----8<-----8<-----8<-----8<-----8<---
> 
> Use of uninitialized value $y in length at /usr/share/perl5/Date/Manip/Base.pm line 2225.
> Use of uninitialized value $y in concatenation (.) or string at /usr/share/perl5/Date/Manip/Base.pm line 2226.
> Use of uninitialized value $m in length at /usr/share/perl5/Date/Manip/Base.pm line 2228.
> Use of uninitialized value $d in length at /usr/share/perl5/Date/Manip/Base.pm line 2229.
> Use of uninitialized value $h in length at /usr/share/perl5/Date/Manip/Base.pm line 2230.
> Use of uninitialized value $mn in length at /usr/share/perl5/Date/Manip/Base.pm line 2231.
> Use of uninitialized value $s in length at /usr/share/perl5/Date/Manip/Base.pm line 2232.
> Use of uninitialized value $m in concatenation (.) or string at /usr/share/perl5/Date/Manip/Base.pm line 2233.
> Use of uninitialized value $d in concatenation (.) or string at /usr/share/perl5/Date/Manip/Base.pm line 2233.
> Use of uninitialized value $h in concatenation (.) or string at /usr/share/perl5/Date/Manip/Base.pm line 2233.
> Use of uninitialized value $mn in concatenation (.) or string at /usr/share/perl5/Date/Manip/Base.pm line 2233.
> Use of uninitialized value $s in concatenation (.) or string at /usr/share/perl5/Date/Manip/Base.pm line 2233.
> Use of uninitialized value $beg in string comparison (cmp) at /usr/share/perl5/Date/Manip/TZ.pm line 1069.
> Use of uninitialized value $end in string comparison (cmp) at /usr/share/perl5/Date/Manip/TZ.pm line 1071.
> Use of uninitialized value $year in addition (+) at /usr/share/perl5/Date/Manip/TZ.pm line 1072.
> 
> ---8<----8<-----8<-----8<-----8<-----8<-----8<---

Thanks for your bug report.

I can't reproduce the bug with 6.31-1, so it seem to be fixed in the
meantime already.

./lib/Date/Manip/Changes6.pod says for "VERSION 6.10 (2010-04-29)":

    Since (if the date falls during a daylight saving time period)
    you usually want to use a time zone that has that offset in
    daylight saving time, the default is now to check daylight saving
    time zones first, followed by standard times.


With 6.11-1 on stable I get the same result as you.

Ah, Date::Manip::Examples is interesting:

    It should be noted that any time you want to work with alternate
    time zones, the OO interface is STRONGLY recommended since the
    functional interface does not preserve time zone information with
    the date, and may therefore give incorrect results in some cases.
    However, working in the time zone of the system should give
    correct results.


And indeed, with 6.11-1 this (the second part) works:

#v+
#!/usr/bin/perl

use strict; use warnings;

use Date::Manip;

&Date_Init();

my $functional_date = ParseDate("2012-03-25 at 02:11");

my $oo_date = new Date::Manip::Date;
my $err = $oo_date->parse("2012-03-25 at 02:11");
#v-


So it seems that is a case of finding the nice details and docs, and
we can close the bug (either unversioned, since the OO interface also
works in stable, or with 6.30-1, since this contains a fix for the
functional interface).


Cheers,
gregor

-- 
 .''`.  Homepage: http://info.comodo.priv.at/ - OpenPGP key 0xBB3A68018649AA06
 : :' : Debian GNU/Linux user, admin, and developer  -  http://www.debian.org/
 `. `'  Member of VIBE!AT & SPI, fellow of the Free Software Foundation Europe
   `-   NP: Simon & Garfunkel: Kathy's Song
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-perl-maintainers/attachments/20120327/8921d7df/attachment.pgp>


More information about the pkg-perl-maintainers mailing list