From c944b2f5991d637a420411e0ebcc1049e149413f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Sat, 4 Mar 2023 00:49:07 +0800 Subject: [PATCH] DateTime: correct format as yyyy-MM-dd --- CHANGELOG.md | 3 +++ src/modules/datetime.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 77cf7ee4f..da005ae42 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # dev +Bugfixes: +* Fix date time format + Changes: * Use yyjson to parse JSON strings for comments support, instead of using unmaintained cJSON diff --git a/src/modules/datetime.c b/src/modules/datetime.c index 25f08da5a..968d17725 100644 --- a/src/modules/datetime.c +++ b/src/modules/datetime.c @@ -43,6 +43,6 @@ void ffPrintDateTime(FFinstance* instance) const FFDateTimeResult* datetime = ffDetectDateTime(instance); ffPrintLogoAndKey(instance, FF_DATETIME_MODULE_NAME, 0, &instance->config.dateTime.key); - //yyyy-mm-dd hh:mm:ss - printf("%u-%s-%u %s:%s:%s\n", datetime->year, datetime->monthPretty.chars, datetime->dayInMonth, datetime->hourPretty.chars, datetime->minutePretty.chars, datetime->secondPretty.chars); + //yyyy-MM-dd HH:mm:ss + printf("%u-%s-%02u %s:%s:%s\n", datetime->year, datetime->monthPretty.chars, datetime->dayInMonth, datetime->hourPretty.chars, datetime->minutePretty.chars, datetime->secondPretty.chars); }