MT#3917 Inflate db timestamps to localtime

mr3.2.1
Gerhard Jungwirth 12 years ago
parent 9329d86751
commit 90d6b22cd7

@ -33,7 +33,8 @@ sub _inflate_to_datetime {
unless $info->{data_type} eq "decimal"
|| (exists $info->{inflate_datetime}
&& $info->{inflate_datetime} eq 'epoch_micro');
return DateTime->from_epoch(epoch => $value);
my $tz = DateTime::TimeZone->new( name => 'local' );
return DateTime->from_epoch(epoch => $value, time_zone => $tz);
}
sub _deflate_from_datetime {

@ -33,7 +33,8 @@ sub _inflate_to_datetime {
unless $info->{data_type} eq "decimal"
|| (exists $info->{inflate_datetime}
&& $info->{inflate_datetime} eq 'epoch_milli');
return DateTime->from_epoch(epoch => $value);
my $tz = DateTime::TimeZone->new( name => 'local' );
return DateTime->from_epoch(epoch => $value, time_zone => $tz);
}
sub _deflate_from_datetime {

@ -33,7 +33,8 @@ sub _inflate_to_datetime {
unless $info->{ data_type } eq "varchar"
|| (exists $info->{ inflate_datetime }
&& $info->{ inflate_datetime } eq 'epoch_string');
return DateTime->from_epoch( epoch => int($value) );
my $tz = DateTime::TimeZone->new( name => 'local' );
return DateTime->from_epoch(epoch => $value, time_zone => $tz);
}
sub _deflate_from_datetime {

Loading…
Cancel
Save