[Koha-bugs] [Bug 12669] "Template process failed: undef error - Invalid local time for date in time zone"

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Aug 22 16:20:00 CEST 2014


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12669

--- Comment #9 from Jonathan Druart <jonathan.druart at biblibre.com> ---
I am not sure this is the right way to fix it.

For instance, in Paris the DST is at 2:

perl -MDateTime -E'say DateTime->new(year => 2014, month => 9, day => 7, hour
=> 0, time_zone => "America/Santiago");';
Invalid local time for date in time zone: America/Santiago

perl -MDateTime -E'say DateTime->new(year => 2014, month => 3, day => 30, hour
=> 2, time_zone => "Europe/Paris");';
Invalid local time for date in time zone: Europe/Paris

perl -MDateTime -E'say DateTime->new(year => 2014, month => 3, day => 30,
time_zone => "Europe/Paris");';
2014-03-30T00:00:00

The DateTime doc mentions "This may change in future version of this module."
http://search.cpan.org/~drolsky/DateTime-1.10/lib/DateTime.pm#Invalid_Local_Times

What about something like:
  my $dt = eval { DateTime->new($params) };
  if ( $@ ) {
    $params->{hours}++;
    $dt = Datetime->new($params);
  }
?

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list