https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29718
Bug ID: 29718
Summary: DateTime - our 'iso' is not ISO 8601
Change sponsored?: ---
Product: Koha
Version: unspecified
Hardware: All
OS: All
Status: In Discussion
Severity: enhancement
Priority: P5 - low
Component: Architecture, internals, and plumbing
Assignee: [email protected]
Reporter: [email protected]
QA Contact: [email protected]
CC: [email protected], [email protected]
In some scripts we are doing unnecessary conversion from string to DT and
vice-versa, sometimes several times.
For instance, see bug 29711. We have epoch => DT => string => sending to
template in 'iso' YYYY-MM-DD HH:MM => DT => string.
This is because the stringified version of DT (the real ISO 8601
YYYY-MM-DDTHH:MM:SS) is not supported by our dt_from_string method.
There are (at least) two options:
* Use DateTime::Format::Strptime
In dt_from_string:
my $formatter = DateTime::Format::Strptime->new(pattern => '%Y-%m-%d
%H:%M:%S');
return DateTime->now(
time_zone => $tz,
formatter => $formatter,
) unless $date_string;
Then later
$dt_params{formatter} = $formatter;
But that's an overhead for all dt_from_string calls.
* add "T?" to $time_re, easy and efficient.
--
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]
https://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/