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.
This commit is contained in:
agessaman committed 2026-03-01 17:00:32 -08:00
1 parent 217d2a4089
commit 5c8ee3564e
1 file changed
+2 -1
+2 -1
View File
@@ -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()