home-assistant_OctopusAgile icon indicating copy to clipboard operation
home-assistant_OctopusAgile copied to clipboard

Suggestion - convert to unix timestamp on reading API

Open borpin opened this issue 5 years ago • 0 comments
trafficstars

https://github.com/markgdev/home-assistant_OctopusAgile/blob/51dba6f542304b5200f78abdbde42a99df4bcf87/OctopusAgile/Agile.py#L224

I suggest at this point, convert the datetime from the API to a Unix timestamp (replace Z with +00:00 and use fromISO). It will save lots of strfrtime calls throughout your code and should avoid timezone issues. As a general principle, it is always best to store data with Unix timestamps.

borpin avatar Jul 02 '20 18:07 borpin