[Koha-devel] DateTime::Format::MySQL

Chris Nighswonger cnighswonger at foundations.edu
Thu May 24 15:50:33 CEST 2012


Hi all,

The QOTD work recently committed to master adds DateTime::Format::MySQL as
a core dependency thereby extending DateTime objects to handle proper
formatting of datetime strings for MySQL.

While Koha::DateUtils will parse ISO formatted datetime strings, the POD
notes that the module is intended to be a temporary aid
to demystify DateTime foo while we are transitioning fully to DateTime:

"Koha has historically only used dates not datetimes and been content to
40
handle these as strings. It also has confused formatting with actual dates
41
this is a temporary module for wrappers to hide the complexity of
switch to DateTime"

There are similar DateTime::Format::<db> plugins for Pg, Oracle, and
friends which may be implemented in Koha as support for those db's is added.

Basically DateTime::Format::MySQL will parse a correctly MySQL formatted
datetime and return a DateTime object for your morphing pleasure.

It will also format a DateTime object and return a MySQL datetime string.

Read more here: http://tinyurl.com/br49o38

By moving away form a custom DateTime formatting module we reduce long
term maintenance costs and issues as well as moving a step closer to
dropping the temporary Koha::DateUtils.

Kind Regards,
Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/koha-devel/attachments/20120524/ce4198e5/attachment.htm>


More information about the Koha-devel mailing list