Help for this page

Select Code to Download


  1. 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) });
    
  2. or download this
    [% date_col.ymd('-') %]