MHKiT-Software / MHKiT-Python

MHKiT-Python provides the marine renewable energy (MRE) community tools for data processing, visualization, quality control, resource assessment, and device performance.
https://mhkit-software.github.io/MHKiT/
BSD 3-Clause "New" or "Revised" License
47 stars 45 forks source link

Improper datetime conversion in CDIP IO #153

Closed Matthew-Boyd closed 2 years ago

Matthew-Boyd commented 2 years ago

Line 91 and 92 in cdip.py is converting POSIX time to a local time and then setting, instead of converting, the timezone to UTC. Instead, it should either convert the POSIX time to UTC by using utcfromtimestamp() instead of fromtimestamp(), or convert the local time to UTC by using .astimezone(pytz.timezone('UTC')) instead of .replace(tzinfo=timezone.utc)