From 6e3b2fd56f24ef50a29445e969076d1112955000 Mon Sep 17 00:00:00 2001 From: Ben Greear Date: Mon, 25 Mar 2019 13:03:01 -0700 Subject: [PATCH] hostap-timestamp: Add perl script to turn hostap timestamp into human readable timestamp. --- hostap_timestamp.pl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 hostap_timestamp.pl 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; + } +}