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

          Priority: P5 - low
 Change sponsored?: ---
            Bug ID: 9031
                CC: [email protected], [email protected]
          Assignee: [email protected]
           Summary: Overdue items crossing DST boundary throw invalid
                    local time exception
          Severity: minor
    Classification: Unclassified
                OS: All
          Reporter: [email protected]
          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.
_______________________________________________
Koha-bugs mailing list
[email protected]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to