fix: timezone issue

This commit is contained in:
Tobias Reisinger 2020-05-07 01:41:16 +02:00
parent ad7a6028b3
commit 27cec1d8cc
10 changed files with 27 additions and 28 deletions

View file

@ -46,8 +46,7 @@ logger_log(FILE *stream, log_level_t level, const char *filename, int line, cons
}
char timestamp_str[32];
time_t rawtime;
time(&rawtime);
time_t rawtime = time(NULL);
strftime(timestamp_str, 32, "%Y-%m-%d %H:%M:%S", localtime(&rawtime));
fprintf(stream, "%s %s:%d:%s " COLOR_NONE, timestamp_str, filename, line, func);