From 0d874723576761d99124894876c438a3c27e7a80 Mon Sep 17 00:00:00 2001 From: tison Date: Sun, 11 Aug 2024 22:58:26 +0800 Subject: [PATCH] make strptime work well Signed-off-by: tison --- src/append/rolling_file/rolling.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/append/rolling_file/rolling.rs b/src/append/rolling_file/rolling.rs index 82e2866..4f4ff0d 100644 --- a/src/append/rolling_file/rolling.rs +++ b/src/append/rolling_file/rolling.rs @@ -277,7 +277,11 @@ impl State { if self.log_filename_prefix.is_none() && self.log_filename_suffix.is_none() - && Zoned::strptime(self.date_format, filename).is_err() + && Zoned::strptime( + format!("{} %:z", self.date_format), + format!("{filename} +00:00"), + ) + .is_err() { return None; }