hostap-timestamp: Add perl script to turn hostap timestamp into human readable timestamp.

This commit is contained in:
Ben Greear
2019-03-25 13:03:01 -07:00
parent 0cd8123add
commit 6e3b2fd56f

18
hostap_timestamp.pl Executable file
View File

@@ -0,0 +1,18 @@
#!/usr/bin/perl
use POSIX qw( strftime );
while (<>) {
my $ln = $_;
if ($ln =~ /^(\d+)\.(\d+): (.*)/) {
my $time_sec = $1;
my $usec = $2;
my $rest = $3;
my $usec_pad = sprintf("%06d", $usec);
my $dt = strftime("%Y-%m-%d %H:%M:%S", localtime($time_sec));
print "$dt.$usec_pad $rest\n";
}
else {
print $ln;
}
}