Summary: | Why does dt_from_string not understand yyyy-mm-ddThh:mm:ss ? | ||
---|---|---|---|
Product: | Koha | Reporter: | Marcel de Rooy <m.de.rooy> |
Component: | Architecture, internals, and plumbing | Assignee: | Marcel de Rooy <m.de.rooy> |
Status: | RESOLVED LATER | QA Contact: | Testopia <testopia> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | jonathan.druart, mtompset |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Bug 19222: Why does dt_from_string not understand yyyy-mm-ddThh:mm:ss?
Bug 19222: Why does dt_from_string not understand yyyy-mm-ddThh:mm:ss? Bug 19222: Why does dt_from_string not understand yyyy-mm-ddThh:mm:ss? |
Description
Marcel de Rooy
2017-08-31 12:36:05 UTC
Created attachment 66669 [details] [review] Bug 19222: Why does dt_from_string not understand yyyy-mm-ddThh:mm:ss? dt_from_string disregards the time part when there is a T before it. But note that if you print a datetime it actually prints that T. Like: 2017-08-31T13:32:37 A small regex adjustment could be helpful. Test plan: Run t/DateUtils.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Use case: I get values like 2017-08-31T13:32:37 from outside xml and want to call dt_from_string on them when importing in a plugin. Created attachment 66968 [details] [review] Bug 19222: Why does dt_from_string not understand yyyy-mm-ddThh:mm:ss? dt_from_string disregards the time part when there is a T before it. But note that if you print a datetime it actually prints that T. Like: 2017-08-31T13:32:37 A small regex adjustment could be helpful. Test plan: Run t/DateUtils.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Mark Tompsett <mtompset@hotmail.com> I suppose my pondering over [Z\+-]\d{2}:?\d{2} or something similar for the timezone offset is best saved for another bug, right? (In reply to M. Tompsett from comment #4) > I suppose my pondering over [Z\+-]\d{2}:?\d{2} or something similar for the > timezone offset is best saved for another bug, right? Thx for signing off. Yeah, open a new report :) Created attachment 68601 [details] [review] Bug 19222: Why does dt_from_string not understand yyyy-mm-ddThh:mm:ss? dt_from_string disregards the time part when there is a T before it. But note that if you print a datetime it actually prints that T. Like: 2017-08-31T13:32:37 A small regex adjustment could be helpful. Test plan: Run t/DateUtils.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> I discuss this with somebody already, but cannot find the logs. I do not think we should support this new format, it is the string representation of a DateTime object. If we support it that could lead to hidden bugs. Some time far away |