[Catalyst] datetime formatting ...

Eden Cardim edencardim at gmail.com
Thu Feb 11 15:45:41 GMT 2010


>>>>> "Kiffin" == Kiffin Gish <kiffin.gish at planet.nl> writes:

    Kiffin> I've got a datetime column defined:
    __PACKAGE__-> add_columns(
    Kiffin>   ...  "last_modified", { data_type => "DATETIME",
    Kiffin> default_value => undef, is_nullable => 1, size => undef, },
    Kiffin> );

    Kiffin> For some reason it's being displayed like this:

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

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

->last_modified->strftime('%F %T')

See perldoc DateTime for more formatting options.

-- 
   Eden Cardim       Need help with your Catalyst or DBIx::Class project?
  Code Monkey                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://edenc.vox.com/            http://www.shadowcat.co.uk/servers/




More information about the Catalyst mailing list