]> granicus.if.org Git - pgbadger/commitdiff
Use of internal values for hours, minutes and seconds.
authorLuca Ferrari <fluca1978@gmail.com>
Tue, 4 Jun 2019 06:25:18 +0000 (08:25 +0200)
committerLuca Ferrari <fluca1978@gmail.com>
Tue, 4 Jun 2019 06:25:18 +0000 (08:25 +0200)
See discussion
<https://github.com/darold/pgbadger/pull/501#issuecomment-498476989>

pgbadger

index 5b7d5953f2cf797225bebae4ee4bdadde378658a..a6bad21eba19db9d546048656b59c92d580a083b 100755 (executable)
--- 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