Skip Menu |

This queue is for tickets about the DateTime-Format-CLDR CPAN distribution.

Report information
The Basics
Id: 89846
Status: resolved
Priority: 0/
Queue: DateTime-Format-CLDR

People
Owner: Nobody in particular
Requestors: gonzalo.mateo [...] meteologica.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



CC: Pablo Rodríguez <pablo.rodriguez [...] meteologica.com>
Subject: Weird behaviour with kk format for hours
Date: Tue, 29 Oct 2013 16:41:04 +0100
To: bug-DateTime-Format-CLDR [...] rt.cpan.org
From: Gonzalo Mateo <gonzalo.mateo [...] meteologica.com>
Hello, We have detected an issue while parsing dates with kk option for hours. We don't know if it is the expected behaviour but if so it should be menctioned in the documentation. We were expecting kk option to substract one to the hour and then setting it while the behaviour is setting the hour as it comes unless it is 24 set it to 0. It happens that with date "2013/07/21 24:00" it returns date: 2013-07-21T00:00:00 while the natural behaviour (we understand) should be returning 2013-07-21T23:00:00. In the case the date is "2013/07/21 01:00" we think the formated date should be: 2013-07-21T00:00:00 print $]."\n"; my $cldr = new DateTime::Format::CLDR( pattern => 'yyyy/MM/dd kk:mm', time_zone => 'Europe/Madrid', ); print "Formatter: DateTime::Format::CLDR ".$cldr->parse_datetime("2013/07/21 24:00")."\n"; print "Formatter: DateTime::Format::CLDR ".$cldr->parse_datetime("2013/07/21 01:00")."\n"; print "Formatter: DateTime::Format::CLDR ".$cldr->parse_datetime("2013/07/21 02:00")."\n"; print "Formatter: DateTime::Format::CLDR ".$cldr->parse_datetime("2013/07/21 03:00")."\n"; Output: 5.016002 Formatter: DateTime::Format::CLDR 2013-07-21T00:00:00 Formatter: DateTime::Format::CLDR 2013-07-21T01:00:00 Formatter: DateTime::Format::CLDR 2013-07-21T02:00:00 Formatter: DateTime::Format::CLDR 2013-07-21T03:00:00 Thank you in advance for your help Yours faithfully *_____________________________________________________________________________________* * * *Gonzalo Mateo García* - mailto: gonzalo.mateo@meteologica.com *__________________________________________________________________________________________________________*

Message body is not shown because sender requested not to inline it.

Please have a look at the documentation in the new 1.16 release. There are also some new testcases for this issue