From f8aea242c79c78ad14e69a51b82b3dfc68762fbe Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Wed, 30 Apr 2025 18:11:29 +0200 Subject: [PATCH] format_time: output date/time in local tz, fixes #8802 --- src/borg/helpers/time.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/borg/helpers/time.py b/src/borg/helpers/time.py index 5e2e85ee6..98a6c6f5a 100644 --- a/src/borg/helpers/time.py +++ b/src/borg/helpers/time.py @@ -89,9 +89,9 @@ def safe_timestamp(item_timestamp_ns): def format_time(ts: datetime, format_spec=""): """ - Convert *ts* to a human-friendly format with textual weekday. + Convert *ts* to a human-friendly format with textual weekday (in local timezone). """ - return ts.strftime("%a, %Y-%m-%d %H:%M:%S %z" if format_spec == "" else format_spec) + return ts.astimezone().strftime("%a, %Y-%m-%d %H:%M:%S %z" if format_spec == "" else format_spec) def format_timedelta(td):