[Koha-bugs] [Bug 24643] New: Koha::DateUtils::dt_from_string rfc3339 cannot handle high precision seconds
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Wed Feb 12 17:02:15 CET 2020
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24643
Bug ID: 24643
Summary: Koha::DateUtils::dt_from_string rfc3339 cannot handle
high precision seconds
Change sponsored?: ---
Product: Koha
Version: master
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P5 - low
Component: Architecture, internals, and plumbing
Assignee: koha-bugs at lists.koha-community.org
Reporter: andrew.isherwood at ptfs-europe.com
QA Contact: testopia at bugs.koha-community.org
The RFC3339 spec (https://www.ietf.org/rfc/rfc3339.txt) says that the second
component of a date/time can contain fractions of a second, e.g.
2011-10-05T14:48:00.000Z
This is the format returned by Javascript's toISOString() function.
Unfortunately, when dt_from_string encounters a string in this format, it
effectively drops the time component entirely and you end up with:
2011-10-05T00:00:00Z
The problem lies in the regex that attempts to match the string when
dt_from_string is called with the 'rfc3339' parameter. Adding support for
optional fractions is straightforward.
--
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
More information about the Koha-bugs
mailing list