From 5639d49e489bbbc0ccf044ae2d17f7ded9971288 Mon Sep 17 00:00:00 2001 From: Michael Black W9MDB Date: Mon, 31 Aug 2020 23:03:58 -0500 Subject: [PATCH] Fix -Z time display https://github.com/Hamlib/Hamlib/issues/360 --- src/debug.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/debug.c b/src/debug.c index 70fc6acc0..1aacbb56d 100644 --- a/src/debug.c +++ b/src/debug.c @@ -150,10 +150,12 @@ char *date_strget(char *buf, int buflen) { char tmp[16]; struct tm *mytm; + time_t t; struct timeval tv; - gettimeofday(&tv, NULL); - mytm = gmtime(&tv.tv_sec); + t = time(NULL); + mytm = gmtime(&t); strftime(buf, buflen, "%Y-%m-%d:%H:%M:%S.", mytm); + gettimeofday(&tv, NULL); sprintf(tmp, "%06ld", (long)tv.tv_usec); strcat(buf, tmp); return buf;