Subject: | Bad parsing of 24 hour |
Date: | Fri, 2 Aug 2013 15:30:40 +0200 |
To: | bug-DateTime-Format-CLDR [...] rt.cpan.org |
From: | Gonzalo Mateo <gonzalo.mateo [...] meteologica.com> |
Dear Sir or Madam,
We have detected a problem while parsing csv files with dates in the
following format:
...
2013.07.21 23:45:00
2013.07.21 24:00:00
2013.07.21 00:15:00
2013.07.21 00:30:00
2013.07.21 00:45:00
...
We found out that if we parse those dates with pattern 'yyyy.MM.dd
HH:mm:ss' when it comes to date with hour 24, it parses the date with hour
and minute: 02:40. It does this transformation without giving warning
message or failing.
Code:
my $cldr = new DateTime::Format::CLDR(
pattern => 'yyyy.MM.dd HH:mm:ss',
time_zone => 'Europe/Madrid',
);
print $cldr->parse_datetime("2013.07.21 24:00:00")."\n";
Output:
2013-07-21T02:40:00
We attach a complete version of the script with the output produced. We
wonder if there is a way to get around this problem that does not imply
manual pre-processing the dates.
If you require any further information, feel free to contact me.
Thank you in advance for your help,
Yours faithfully
==========================================
Gonzalo Mateo García
Meteologica SA
C. Heliotropo, 5
28029 Madrid
gonzalo.mateo@meteologica.com
==========================================
Message body is not shown because sender requested not to inline it.
Message body is not shown because sender requested not to inline it.