From 684a4fd321edc15be602e4f42aff7a662343918b Mon Sep 17 00:00:00 2001 From: Theo Buehler Date: Wed, 20 Apr 2022 15:29:25 +0000 Subject: Print UTC time with gmtime() This replaces a strange hack that sets TZ=UTC and calls localtime(). Tweak format string to keep printing UTC. ok claudio --- usr.sbin/rpki-client/output.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'usr.sbin/rpki-client/output.c') diff --git a/usr.sbin/rpki-client/output.c b/usr.sbin/rpki-client/output.c index b23b3f8066d..fc22af28d8d 100644 --- a/usr.sbin/rpki-client/output.c +++ b/usr.sbin/rpki-client/output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: output.c,v 1.25 2022/04/19 13:52:24 claudio Exp $ */ +/* $OpenBSD: output.c,v 1.26 2022/04/20 15:29:24 tb Exp $ */ /* * Copyright (c) 2019 Theo de Raadt * @@ -204,9 +204,8 @@ outputheader(FILE *out, struct stats *st) int i; time(&t); - setenv("TZ", "UTC", 1); - tp = localtime(&t); - strftime(tbuf, sizeof tbuf, "%a %b %e %H:%M:%S %Z %Y", tp); + tp = gmtime(&t); + strftime(tbuf, sizeof tbuf, "%a %b %e %H:%M:%S UTC %Y", tp); gethostname(hn, sizeof hn); -- cgit v1.2.3