diff --git a/hostap_timestamp.pl b/hostap_timestamp.pl new file mode 100755 index 00000000..eb8b2c1c --- /dev/null +++ b/hostap_timestamp.pl @@ -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; + } +}