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.
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