mirror of
https://github.com/l5yth/potato-mesh.git
synced 2026-05-05 21:12:45 +02:00
refactor: replace deprecated utcfromtimestamp (#30)
This commit is contained in:
@@ -89,7 +89,11 @@ def upsert_node(node_id, n):
|
||||
# --- Message logging via PubSub -----------------------------------------------
|
||||
def _iso(ts: int | float) -> str:
|
||||
import datetime
|
||||
return datetime.datetime.utcfromtimestamp(int(ts)).isoformat() + "Z"
|
||||
return (
|
||||
datetime.datetime.fromtimestamp(int(ts), datetime.UTC)
|
||||
.isoformat()
|
||||
.replace("+00:00", "Z")
|
||||
)
|
||||
|
||||
def _first(d: dict, *names, default=None):
|
||||
"""Return first present key from names (supports nested 'a.b' lookups)."""
|
||||
|
||||
Reference in New Issue
Block a user