From 5c8ee3564ebb8e31c8ad399b8d8e9edaa6ad5b0a Mon Sep 17 00:00:00 2001 From: agessaman Date: Sun, 1 Mar 2026 17:00:32 -0800 Subject: [PATCH] Fix time zone handling in format_elapsed_display function -- issue #75 - Updated the import statement for time zone handling in the `format_elapsed_display` function to use `timezone.utc` instead of `UTC` from `datetime`. - Improved clarity and consistency in time zone management within the function. --- modules/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/utils.py b/modules/utils.py index d09347a..3ed6f45 100644 --- a/modules/utils.py +++ b/modules/utils.py @@ -2028,7 +2028,8 @@ def format_elapsed_display(ts: Any, translator: Any = None) -> str: ts_f = float(ts) except (TypeError, ValueError): return _sync_str() - from datetime import UTC, datetime + from datetime import datetime, timezone + UTC = timezone.utc elapsed_ms = (datetime.now(UTC).timestamp() - ts_f) * 1000 if elapsed_ms < 0 or elapsed_ms > _ELAPSED_MS_MAX: return _sync_str()