Skip to content

Commit

Permalink
[Bug fix] Force set timezone in system start unix to utc
Browse files Browse the repository at this point in the history
  • Loading branch information
cffls committed Mar 30, 2023
1 parent f5542b4 commit 7771a3c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pycardano/backend/ogmios.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import json
from datetime import datetime
from datetime import datetime, timezone
from enum import Enum
from typing import Any, Dict, List, Optional, Tuple, Union

Expand Down Expand Up @@ -193,6 +193,7 @@ def _fetch_genesis_param(self) -> GenesisParameters:
result = self._query_genesis_config()
start_str = result["systemStart"].split(".")[0]
dt = datetime.fromisoformat(start_str.replace("Z", "+00:00"))
dt = dt.replace(tzinfo=timezone.utc)
system_start_unix = int(dt.timestamp())
return GenesisParameters(
active_slots_coefficient=self._fraction_parser(
Expand Down

0 comments on commit 7771a3c

Please sign in to comment.