Update service_logger.c (#1451)

格式化时间改为通用的结构,修复windows上时间显示不正确问题
This commit is contained in:
coder
2021-08-05 16:36:49 +08:00
committed by GitHub
parent 0e9c0c34a9
commit 0207b9210a

View File

@@ -40,7 +40,7 @@ timestring(struct logger *inst, char tmp[SIZETIMEFMT]) {
time_t ti = now/100 + inst->starttime; time_t ti = now/100 + inst->starttime;
struct tm info; struct tm info;
(void)localtime_r(&ti,&info); (void)localtime_r(&ti,&info);
strftime(tmp, SIZETIMEFMT, "%D %T", &info); strftime(tmp, SIZETIMEFMT, "%d/%m/%y %H:%M:%S", &info);
return now % 100; return now % 100;
} }