mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-10-30 10:22:34 +00:00
hostap-timestamp: Add perl script to turn hostap timestamp into human readable timestamp.
This commit is contained in:
18
hostap_timestamp.pl
Executable file
18
hostap_timestamp.pl
Executable 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user