(RADIATOR) Surprising behaviour from %J?

Robin Breathe rbreathe at brookes.ac.uk
Wed Apr 16 05:26:45 CDT 2008


We had a small surprise at the beginning of the month having started 
using the %J special string formatting character in an AcctColumnDef 
against a PostgreSQL backend (timestamp column). The documentation states:

  %J: The Timestamp in another common SQL date time format:
      2003-09-12 15:48:00

However, the date format used is '%Y-%m-%e %H:%M:%S', so come the first 
of April we had "2008-04- 1 00:12:34", which was rightly thrown out by 
PostgreSQL.

Attached is a trivial patch to change the date format to '%Y-%m-%d 
%H:%M:%S', ensuring a leading 0 on the day component and a valid SQL date.

Regards,
Robin
-- 
Robin Breathe, Computer Services, Oxford Brookes University, Oxford, UK
rbreathe at brookes.ac.uk       Tel: +44 1865 483685  Fax: +44 1865 483073
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Util.pm.diff
URL: <http://www.open.com.au/pipermail/radiator/attachments/20080416/483a48cc/attachment.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: OpenPGP digital signature
URL: <http://www.open.com.au/pipermail/radiator/attachments/20080416/483a48cc/attachment.bin>


More information about the radiator mailing list