Subject: | America/Santiago can't parse date if it is when DST starts at midnight |
Date: | Wed, 5 Dec 2018 14:16:03 -0600 |
To: | bug-Date-Manip [...] rt.cpan.org |
From: | Paul Schilling <paul [...] schillingconsulting.com> |
I believe this isn't limited just to Santiago but any TZ that has Daylight Saving Time starting at midnight and passing in just a date.
If I try to parse 2018-08-12 it doesn't work, this is when Daylight Saving Time started and they jump forward 1 hour at midnight. If I add a time (after 1AM) then it does work.
schilling13 5:09PM ~ > cat /etc/timezone
America/Santiago
schilling13 5:09PM ~ > perl -e 'use Date::Manip; print $Date::Manip::VERSION, "\n"; print &Date::Manip::ParseDate("8/12/2018 01:00:00"), "\n";'
6.75
2018081201:00:00
schilling13 5:09PM ~ > perl -e 'use Date::Manip; print $Date::Manip::VERSION, "\n"; print &Date::Manip::ParseDate("8/12/2018"), "\n";'
6.75
Shouldn't it just check if the date is valid? Not it is is within the time that doesn't exist? I could understand if I sent in 2018-08-12 00:23:00 it would fail as an invalid date/time.
Thanks.
--
Paul Schilling
Schilling Consulting LLC
paul@schillingconsulting.com
schilling13 5:09PM ~ > perl -v
This is perl 5, version 24, subversion 1 (v5.24.1) built for i686-linux-gnu-thread-multi-64int
(with 81 registered patches, see perl -V for more detail)
Copyright 1987-2017, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
schilling13 5:09PM ~ > uname -a
Linux schilling13 4.9.0-6-686-pae #1 SMP Debian 4.9.82-1+deb9u3 (2018-03-02) i686 GNU/Linux