[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
Wed May 4 04:55:15 CEST 2016


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

David Cook <dcook at prosentient.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dcook at prosentient.com.au

--- Comment #30 from David Cook <dcook at prosentient.com.au> ---
I don't think this patch is actually a good idea... you're only sometimes - and
very unexpectedly - making a DateTime object with a floating timezone. 

Consider the following from DateTime's perldoc
(http://search.cpan.org/~drolsky/DateTime-1.26/lib/DateTime.pm#):

"Floating DateTimes

The default time zone for new DateTime objects, except where stated otherwise,
is the "floating" time zone. This concept comes from the iCal standard. A
floating datetime is one which is not anchored to any particular time zone. In
addition, floating datetimes do not include leap seconds, since we cannot apply
them without knowing the datetime's time zone.

The results of date math and comparison between a floating datetime and one
with a real time zone are not really valid, because one includes leap seconds
and the other does not. Similarly, the results of datetime math between two
floating datetimes and two datetimes with time zones are not really comparable.

If you are planning to use any objects with a real time zone, it is strongly
recommended that you do not mix these with floating datetimes."

--

I think it would be smarter to actually review where we're using timezones and
re-read
http://search.cpan.org/~drolsky/DateTime-1.26/lib/DateTime.pm#How_DateTime_Math_Works. 

--

Another idea would be to use DateTime->ymd() instead of DateTime->truncate()
(http://search.cpan.org/~drolsky/DateTime-1.26/lib/DateTime.pm#$dt->ymd(_$optional_separator_),_$dt->mdy(...),_$dt->dmy(...)),
so that you're actually just comparing the date portion of a datestamp rather
than possibly creating an invalid local time.

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


More information about the Koha-bugs mailing list