提交 26b74307 编写于 作者: D Daniel P. Berrange

Fix off-by-one printing month in logging code

The field 'mon' in 'struct tm' gives months 0-11, where as
humans tend to expect months 1-12. Thus the month number
needing adjusting by 1

* src/util/logging.c: Use human friendly month number
上级 f4786c18
......@@ -628,6 +628,7 @@ virLogFormatTimestamp(void)
gettimeofday(&cur_time, NULL);
localtime_r(&cur_time.tv_sec, &time_info);
time_info.tm_year += 1900;
time_info.tm_mon += 1;
if (virAsprintf(&str, "%4d-%02d-%02d %02d:%02d:%02d.%03d",
time_info.tm_year, time_info.tm_mon, time_info.tm_mday,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册