[Dbix-class] Where to set database date format for InflateColumn::DateTime?

Adam Witney awitney at sgul.ac.uk
Thu Apr 17 10:51:50 GMT 2014


Hi,

I have a Catalyst/DBIx::Class application but I am having trouble with 
datetime inflation.

I have a PostgreSQL database with datestyle "SQL, DMY" and timezone 
"GB". The table has a field with datatype "timestamp without timezone", 
so my dates look like "15/04/2014 13:41:50" in the database.

My Result class loads the TimeStamp component, but when I try to render 
the variable in my TT view I get a long error including:

"The 'month' parameter ("15") to DateTime::new did not pass the 'an 
integer between 1 and 12' callback"

I assume it is trying to inflate the field as MDY rather than DMY as is 
set in my database?

I can get the string version of the date by setting the column to 
"'inflate_datetime' => 0", but I would like to get the DateTime object back.

I am having trouble working out how and where I tell my application of 
the database datestyle format, could someone provide any advice?

Thanks

Adam




More information about the DBIx-Class mailing list