Diff between c5eacf109f3342a6162f7df88783a2b04cc21f93 and 114506b359d43fe47d1efad27f7db42fdfaf4701

Changed Files

File Additions Deletions Status
tools/parser/parser.h +10 -2 modified

Full Patch

diff --git a/tools/parser/parser.h b/tools/parser/parser.h
index 0352c09..193c9f2 100644
--- a/tools/parser/parser.h
+++ b/tools/parser/parser.h
@@ -27,6 +27,7 @@
 #ifndef __PARSER_H
 #define __PARSER_H
 
+#include <time.h>
 #include <sys/time.h>
 #include <bluetooth/bluetooth.h>
 #include <netinet/in.h>
@@ -112,8 +113,15 @@ static inline void p_indent(int level, struct frame *f)
 	}
 
 	if (!parser.state) {
-		if (parser.flags & DUMP_TSTAMP)
-			printf("%8lu.%06lu ", f->ts.tv_sec, f->ts.tv_usec);
+		if (parser.flags & DUMP_TSTAMP) {
+			struct tm tm;
+			time_t t = f->ts.tv_sec;
+			localtime_r(&t, &tm);
+			printf("%04d-%02d-%02d %02d:%02d:%02d.%06lu ", 
+				tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
+				tm.tm_hour, tm.tm_min, tm.tm_sec, f->ts.tv_usec);
+			//printf("%8lu.%06lu ", f->ts.tv_sec, f->ts.tv_usec);
+		}
 		printf("%c ", (f->in ? '>' : '<'));
 		parser.state = 1;
 	} else