diff --git a/lib/NGCP/Schema/InflateColumn/DateTime/EpochMicro.pm b/lib/NGCP/Schema/InflateColumn/DateTime/EpochMicro.pm index 9ebf52ee..41912a2e 100644 --- a/lib/NGCP/Schema/InflateColumn/DateTime/EpochMicro.pm +++ b/lib/NGCP/Schema/InflateColumn/DateTime/EpochMicro.pm @@ -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 { diff --git a/lib/NGCP/Schema/InflateColumn/DateTime/EpochMilli.pm b/lib/NGCP/Schema/InflateColumn/DateTime/EpochMilli.pm index 7d8e530f..265b1bb5 100644 --- a/lib/NGCP/Schema/InflateColumn/DateTime/EpochMilli.pm +++ b/lib/NGCP/Schema/InflateColumn/DateTime/EpochMilli.pm @@ -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 { diff --git a/lib/NGCP/Schema/InflateColumn/DateTime/EpochString.pm b/lib/NGCP/Schema/InflateColumn/DateTime/EpochString.pm index f7007b06..fc219447 100644 --- a/lib/NGCP/Schema/InflateColumn/DateTime/EpochString.pm +++ b/lib/NGCP/Schema/InflateColumn/DateTime/EpochString.pm @@ -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 {