[Koha-devel] Invalid local time for date in time zone: America/Santiago
David Cook
dcook at prosentient.com.au
Thu Apr 28 04:53:35 CEST 2016
Oh, that’s interesting.
I’ve seen this happen on other Perl projects during daylight savings time changes.
For instance, try the following Perl code:
use DateTime;
my $dt = DateTime->new(
year => 2015,
month => 10,
day => 4,
hour => 2,
minute => 0,
second => 0,
time_zone => 'Australia/Sydney',
);
You’ll get the message:
“Invalid local time for date in time zone: Australia/Sydney”
If I recall correctly, it’s because 4 October 2015 2:00am Australia/Sydney didn’t exist. When that time was reached, the clock actually skipped forward, and it became 4 October 2015 3:00am Australia/Sydney. In effect, local time went from 1:59:59 to 3:00:00. 2:00:00 through 2:59:59 never existed. Fascinating, no?
Wikipedia says that Chile stopped observing DST in 2015: <https://en.wikipedia.org/wiki/Daylight_saving_time_in_the_Americas#Chile> https://en.wikipedia.org/wiki/Daylight_saving_time_in_the_Americas#Chile. However, I’m guessing that perhaps your server/the Perl module doesn’t know that?
“Chile currently observes Daylight Saving Time (DST). Instead of turning the clocks back one hour on Sunday, April 26, 2015 as previously planned, the Chilean Government has decided to make no further changes to the clock in future years.” ( <http://www.timeanddate.com/news/time/chile-abolishes-dst-2015.html> http://www.timeanddate.com/news/time/chile-abolishes-dst-2015.html).
Hmm… I don’t know what date is the problem…
Could you run “perl -d overdue_notices.pl -t" again, but use “n” instead of “c”? That way, you’ll be able to see what exact call is generating this error.
I’m guessing it might be one of the lines:
my $today = DateTime->now(time_zone => C4::Context->tz );
But that’s just a guess. What happens if you try running your overdues again? You might have had the misfortune of the overdues just running at the wrong time on the wrong day.
Curious to hear how you go!
David Cook
Systems Librarian
Prosentient Systems
72/330 Wattle St
Ultimo, NSW 2007
Office: 02 9212 0899
Direct: 02 8005 0595
From: koha-devel-bounces at lists.koha-community.org [mailto:koha-devel-bounces at lists.koha-community.org] On Behalf Of Larry Letelier
Sent: Wednesday, 27 April 2016 3:09 PM
To: koha-devel at lists.koha-community.org
Subject: [Koha-devel] Invalid local time for date in time zone: America/Santiago
Hi people,
We have a 'little' issue with the overdue aka notifications process.
# pwd
/usr/share/koha/bin/cronjobs
# ./overdue_notices.pl <http://overdue_notices.pl> -t
Invalid local time for date in time zone: America/Santiago
perl -d overdue_notices.pl <http://overdue_notices.pl> -t
Loading DB routines from perl5db.pl <http://perl5db.pl> version 1.33
Editor support available.
Enter h or `h h' for help, or `man perldebug' for more help.
main::(overdue_notices.pl:278 <http://overdue_notices.pl:278> ): my $dbh = C4::Context->dbh();
DB<1> c
Invalid local time for date in time zone: America/Santiago
at /usr/share/perl5/DateTime/TimeZone.pm line 198
DateTime::TimeZone::_span_for_datetime('DateTime::TimeZone::America::Santiago=HASH(0x60cfce8)', 'local', 'DateTime=HASH(0x617e938)') called at /usr/share/perl5/DateTime/TimeZone.pm line 157
DateTime::TimeZone::offset_for_local_datetime('DateTime::TimeZone::America::Santiago=HASH(0x60cfce8)', 'DateTime=HASH(0x617e938)') called at /usr/lib/perl5/DateTime.pm line 930
DateTime::_offset_for_local_datetime('DateTime=HASH(0x617e938)') called at /usr/lib/perl5/DateTime.pm line 375
DateTime::_calc_utc_rd('DateTime=HASH(0x617e938)') called at /usr/lib/perl5/DateTime.pm line 263
DateTime::_new('DateTime', 'hour', 20, 'second', 0, 'month', 9, 'locale', 'DateTime::Locale::en_US=HASH(0x1e7eac8)', ...) called at /usr/lib/perl5/DateTime.pm line 299
DateTime::_new_from_self('DateTime=HASH(0x6183808)', 'hour', 0, 'minute', 0, 'second', 0, 'month', 9, ...) called at /usr/lib/perl5/DateTime.pm line 1933
DateTime::truncate(undef, 'to', 'day') called at /usr/share/koha/lib/Koha/Calendar.pm line 214
Koha::Calendar::is_holiday('Koha::Calendar=HASH(0x619bc20)', 'DateTime=HASH(0x6192ad0)') called at /usr/share/koha/lib/Koha/Calendar.pm line 290
Koha::Calendar::days_between('Koha::Calendar=HASH(0x619bc20)', 'DateTime=HASH(0x61a5b90)', 'DateTime=HASH(0x60a7ce0)') called at overdue_notices.pl <http://overdue_notices.pl> line 538
Debugged program terminated. Use q to quit or R to restart,
use o inhibit_exit to avoid stopping after program termination,
h q, h R or h o to get additional info.
DB<1> q
This is a Koha 3.2008000
In MySQL and in enviroment, tzdata, TZ='America/Santiago' is set.
Any idea with this ?
Thanks for read this,
-Larry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20160428/6fa96220/attachment-0001.html>
More information about the Koha-devel
mailing list