Harmonize timestamps to UTC
There are some inconsistencies in the use of timestamps across pyswatch (namely datetime.fromtimestamp
vs. datetime.utcfromtimestamp
) which can lead to confusing timestamps in the link test outputs and when comparing with the HERD logs, which are in UTC. This should to be harmonized to use UTC everywhere, and local time zones should only be used in the user interfaces.
From the python docs:
Warning: Because naive datetime objects are treated by many datetime methods as local times, it is preferred to use aware datetimes to represent times in UTC. As such, the recommended way to create an object representing a specific timestamp in UTC is by calling datetime.fromtimestamp(timestamp, tz=timezone.utc).
Similarly, instances of datetime.utcnow()
should be replaced by datetime.now(timezone.utc)