timezone utc

This commit is contained in:
2025-07-09 17:41:23 +03:00
parent 34d9c9f4ab
commit c9a8ecad29

View File

@ -1,4 +1,4 @@
from datetime import datetime from datetime import datetime, timezone
import aiohttp import aiohttp
@ -31,7 +31,7 @@ async def get_transaction_by_hash(
dec = -1 * int(tx.get("token_info", {}).get("decimals", "6")) dec = -1 * int(tx.get("token_info", {}).get("decimals", "6"))
f = float(v[:dec] + "." + v[dec:]) f = float(v[:dec] + "." + v[dec:])
time_ = datetime.fromtimestamp( time_ = datetime.fromtimestamp(
float(tx.get("block_timestamp", "")) / 1000 float(tx.get("block_timestamp", "")) / 1000, timezone.utc
) )
from_ = tx.get("from", "") from_ = tx.get("from", "")
to = tx.get("to", "") to = tx.get("to", "")