From: Luca Ferrari Date: Tue, 4 Jun 2019 06:25:18 +0000 (+0200) Subject: Use of internal values for hours, minutes and seconds. X-Git-Tag: v11.0~23^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=01998e8478729569e8f409a91158aaf1fc858572;p=pgbadger Use of internal values for hours, minutes and seconds. See discussion --- diff --git a/pgbadger b/pgbadger index 5b7d595..a6bad21 100755 --- a/pgbadger +++ b/pgbadger @@ -16003,11 +16003,9 @@ sub skip_unwanted_line # and extract the hour here, late, to get the timezone # already applied if ( $from_hour || $to_hour ){ - $prefix_vars{'t_time'} = $prefix_vars{'t_timestamp'}; - $prefix_vars{'t_time'} =~ s/^(\d{4})-(\d{2})-(\d{2}) //; - - return 1 if ( $from_hour && ( $from_hour gt $prefix_vars{'t_time'} ) ); - return -1 if ( $to_hour && ( $to_hour lt $prefix_vars{'t_time'} ) ); + my $time = "$prefix_vars{'t_hour'}:$prefix_vars{'t_min'}:$prefix_vars{'t_sec'}"; + return 1 if ( $from_hour && ( $from_hour gt $time ) ); + return -1 if ( $to_hour && ( $to_hour lt $time ) ); } # check against date/timestamp