Skip to content

Commit

Permalink
utc timezone fix
Browse files Browse the repository at this point in the history
  • Loading branch information
robotastic committed Feb 1, 2025
1 parent 0848af8 commit d2586e6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dump1090-json/dump1090-json_pub_sub.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
dump1090 endpoint and publishes it to the MQTT broker.
"""
import ast
from datetime import datetime
from datetime import datetime, timezone
import json
import logging
import os
Expand Down Expand Up @@ -286,7 +286,7 @@ def _send_digest(self, data: Dict[str, str]) -> bool:

# Generate payload
payload_json = self.generate_payload_json(
push_timestamp=int(datetime.utcnow().timestamp()),
push_timestamp=int(datetime.now(timezone.utc).timestamp()),
device_type=os.getenv("DEVICE_TYPE", ""),
id_=os.getenv("HOSTNAME", ""),
deployment_id=os.getenv("DEPLOYMENT_ID", ""),
Expand Down Expand Up @@ -330,7 +330,7 @@ def _send_data(self, data: Dict[str, str]) -> bool:

# Generate payload
payload_json = self.generate_payload_json(
push_timestamp=int(datetime.utcnow().timestamp()),
push_timestamp=int(datetime.now(timezone.utc).timestamp()),
device_type=os.getenv("DEVICE_TYPE", ""),
id_=os.getenv("HOSTNAME", ""),
deployment_id=os.getenv("DEPLOYMENT_ID", ""),
Expand Down

0 comments on commit d2586e6

Please sign in to comment.