mirror of
https://github.com/agessaman/meshcore-bot.git
synced 2026-10-22 22:11:15 +00:00
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:
1 parent
217d2a4089
commit
5c8ee3564e
1 file changed
+2
-1
+2
-1
@@ -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()
|
||||
|
||||
Reference in new issue
Block a user