diff options
author | Theo Buehler <tb@cvs.openbsd.org> | 2022-04-20 15:29:25 +0000 |
---|---|---|
committer | Theo Buehler <tb@cvs.openbsd.org> | 2022-04-20 15:29:25 +0000 |
commit | 684a4fd321edc15be602e4f42aff7a662343918b (patch) | |
tree | c4073a897df5390eb6b39578090f22693ee77dbc /usr.sbin/rpki-client/output.c | |
parent | 5c955db4bdf0beb1d100359649fd28f6e53057f0 (diff) |
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
Diffstat (limited to 'usr.sbin/rpki-client/output.c')
-rw-r--r-- | usr.sbin/rpki-client/output.c | 7 |
1 files changed, 3 insertions, 4 deletions
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 <deraadt@openbsd.org> * @@ -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); |