Give an indication of the time zone in the log - quark - quark web server | |
git clone git://git.suckless.org/quark | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit ba38b0969f542e6e7d3f01ba500189a81ca32355 | |
parent 3ff82c514becd08922fcf9bc9f4870941650932a | |
Author: Laslo Hunhold <[email protected]> | |
Date: Tue, 3 Apr 2018 01:23:00 +0200 | |
Give an indication of the time zone in the log | |
We use Zulu-time (aka UTC) for the log timestamps. | |
Diffstat: | |
M main.c | 4 ++-- | |
1 file changed, 2 insertions(+), 2 deletions(-) | |
--- | |
diff --git a/main.c b/main.c | |
@@ -29,7 +29,7 @@ serve(int infd, struct sockaddr_storage *in_sa) | |
time_t t; | |
enum status status; | |
char inaddr[INET6_ADDRSTRLEN /* > INET_ADDRSTRLEN */]; | |
- char tstmp[25]; | |
+ char tstmp[21]; | |
/* set connection timeout */ | |
if (sock_set_timeout(infd, 30)) { | |
@@ -43,7 +43,7 @@ serve(int infd, struct sockaddr_storage *in_sa) | |
/* write output to log */ | |
t = time(NULL); | |
- if (!strftime(tstmp, sizeof(tstmp), "%Y-%m-%dT%H:%M:%S", | |
+ if (!strftime(tstmp, sizeof(tstmp), "%Y-%m-%dT%H:%M:%SZ", | |
gmtime(&t))) { | |
warn("strftime: Exceeded buffer capacity"); | |
goto cleanup; |