Hello!

>> __PACKAGE__->inflate_column('creation_time', {
>>         inflate => sub { DateTime::Format::MySQL->parse_datetime(shift); },
>>         deflate => sub { DateTime::Format::MySQL->format_datetime(shift); },
>>     });
> 
> InflateColumn::DateTime is your friend. There isn't a good reason to
> roll your own inflators/deflators for datetime fields.

Unless you need to convert UTC <-> custom_timezone maybe.

Michele.

-- 
Michele Beltrame
http://www.varlogarthas.net/
ICQ 76660101 - MSN [EMAIL PROTECTED]
Privacy: http://www.italpro.net/em.html


_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/

Reply via email to