or download this
use Time::Piece::mysql;
__PACKAGE__->has_a(date_col => 'Time::Piece');
...
__PACKAGE__->has_a(date_col => 'DateTime',
inflate => sub { DateTime::Format::MySQL->parse_datetime(shift) },
deflate => sub { DateTime::Format::MySQL->format_datetime(shift) });