diff --git a/apps/pvx/restapi/custom/api.pm b/apps/pvx/restapi/custom/api.pm index 72d23b9c0..947801d74 100644 --- a/apps/pvx/restapi/custom/api.pm +++ b/apps/pvx/restapi/custom/api.pm @@ -169,7 +169,7 @@ sub query_range { my $tz = centreon::plugins::misc::set_timezone(name => $self->{timezone}); my $dt = DateTime->now(%$tz); - my $start_time = $dt->subtract(seconds => $options{timeframe})->epoch(); + my $start_time = $dt->epoch() - $options{timeframe}; my $end_time = $dt->epoch(); my $uri = URI::Encode->new({encode_reserved => 1});