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 b314c3f commit dcc6429
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions skyscan-c2/c2_pub_sub.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from typing import Any, Dict, Union
import pandas as pd
import schedule
from datetime import datetime
from datetime import datetime, timezone
from math import radians, cos, sin, asin, sqrt

import math
Expand Down Expand Up @@ -642,7 +642,7 @@ def _target_selection_callback(
logging.debug(f"This is the selected target {payload}")

out_json = self.generate_payload_json(
push_timestamp=str(int(datetime.utcnow().timestamp())),
push_timestamp=str(int(datetime.now(timezone.utc).timestamp())),
device_type="Collector",
id_=self.hostname,
deployment_id=f"ShipScan-{self.hostname}",
Expand All @@ -666,7 +666,7 @@ def _target_selection_callback(
)
else:
out_json = self.generate_payload_json(
push_timestamp=str(int(datetime.utcnow().timestamp())),
push_timestamp=str(int(datetime.now(timezone.utc).timestamp())),
device_type="Collector",
id_=self.hostname,
deployment_id=f"ShipScan-{self.hostname}",
Expand All @@ -691,7 +691,7 @@ def _target_selection_callback(


out_json = self.generate_payload_json(
push_timestamp=str(int(datetime.utcnow().timestamp())),
push_timestamp=str(int(datetime.now(timezone.utc).timestamp())),
device_type="Collector",
id_=self.hostname,
deployment_id=f"ShipScan-{self.hostname}",
Expand Down

0 comments on commit dcc6429

Please sign in to comment.