From: "Kiffin Gish" <kiffin.g...@planet.nl>


I've got a datetime column defined:

__PACKAGE__->add_columns(
 ...
 "last_modified",
 {
   data_type => "DATETIME",
   default_value => undef,
   is_nullable => 1,
   size => undef,
 },
);

For some reason it's being displayed like this:

"2010-01-05T20:35:14"

How can I get that 'T' out of there, replacing it with the usual space?

--
Kiffin Gish <kiffin.g...@planet.nl>
Gouda, The Netherlands

That column is automaticly inflated by the component InflateColumn::DateTime which is loaded above by:

__PACKAGE__->load_components("InflateColumn::DateTime", "Core");

so that column is a DateTime object and you can use the DateTime methods like:

$row->last_modified->ymd
$row->last_modified->set_locale('fr')->strftime('%e %b %Y')
...

If you want, you can disable the inflation by adding (after "do not modify this or anything above'):

     __PACKAGE__->add_columns(
       last_modified => { data_type => 'datetime', inflate_datetime => 0 }
     );

Octavian


_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Reply via email to