1 package DBIx::Class::InflateColumn::DateTime;
5 use base qw/DBIx::Class/;
7 __PACKAGE__->load_components(qw/InflateColumn/);
9 __PACKAGE__->mk_group_accessors('simple' => '__datetime_parser');
12 my ($self, $column, $info, @rest) = @_;
13 $self->next::method($column, $info, @rest);
14 if ($info->{data_type} =~ /^datetime$/i) {
15 $self->inflate_column(
19 my ($value, $obj) = @_;
20 $obj->_datetime_parser->parse_datetime($value);
23 my ($value, $obj) = @_;
24 $obj->_datetime_parser->format_datetime($value);
31 sub _datetime_parser {
33 if (my $parser = $self->__datetime_parser) {
36 my $parser = $self->result_source->storage->datetime_parser(@_);
37 return $self->__datetime_parser($parser);