[Koha-bugs] [Bug 9031] New: Overdue items crossing DST boundary throw invalid local time exception
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Thu Nov 8 14:07:16 CET 2012
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9031
Priority: P5 - low
Change sponsored?: ---
Bug ID: 9031
CC: gmcharlt at gmail.com, kyle.m.hall at gmail.com
Assignee: koha-bugs at lists.koha-community.org
Summary: Overdue items crossing DST boundary throw invalid
local time exception
Severity: minor
Classification: Unclassified
OS: All
Reporter: robsongalluci at hotmail.com
Hardware: All
Status: NEW
Version: 3.8
Component: Circulation
Product: Koha
When checking in an overdue item with a DST boundary between original due date
and actual check in date, we get the invalid local time error.
The issue happens with places that set DST by removing the hour between 0:00
and 0:59, as you can see here
(http://www.nntp.perl.org/group/perl.datetime/2012/06/msg7854.html), not with
every DST boundary crossing.
The problem seems to be in the days_between and hours_between subroutines at
Koha::Calendar. I've made a quick fix converting the dates to UTC before the
calculation of the number of days, but I don't know if it deserves to be a
patch. Ideally, all internal date handling should be done in UTC, using local
timezones for input and output only, as DateTime page recommends:
> - use UTC for all calculations
>
> If you do care about time zones (particularly DST) or leap seconds, try to use
> non-UTC time zones for presentation and user input only. Convert to UTC
> immediately and convert back to the local time zone for presentation
https://metacpan.org/module/DateTime#Making-Things-Simple
--
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
More information about the Koha-bugs
mailing list