From ada18863a7fcaf2534f23499615b03b7dee1fe07 Mon Sep 17 00:00:00 2001 From: Daniel Hofstetter Date: Thu, 16 Jan 2025 09:37:51 +0100 Subject: [PATCH] date: adapt to API change in chrono-tz --- src/uu/date/src/date.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/uu/date/src/date.rs b/src/uu/date/src/date.rs index d91f8f82c..24aaf6967 100644 --- a/src/uu/date/src/date.rs +++ b/src/uu/date/src/date.rs @@ -288,7 +288,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> { // GNU `date` uses `%N` for nano seconds, however crate::chrono uses `%f` let format_string = &format_string .replace("%N", "%f") - .replace("%Z", tz_abbreviation); + .replace("%Z", tz_abbreviation.unwrap_or("UTC")); // Refuse to pass this string to chrono as it is crashing in this crate if format_string.contains("%#z") { return Err(USimpleError::new(