Acceptance criteria
- All uses of
datetime.utcnow() have been replaced with datetime.now(timezone.utc)
Notes
datetime.utcnow() is currently used to set the creation date (global attribute and in file names) in all timeseries_products code, and in ncwriter/imos_template.py
- This function can potentially return the system's local time as if it was UTC (see warning in datetime docs, or in more detail in this blog). This will lead to at most an 11-hour offset, which is not a huge problem, but it would be easy to fix.
- From datetime docs:
the recommended way to create an object representing the current time in UTC is by calling datetime.now(timezone.utc)
Acceptance criteria
datetime.utcnow()have been replaced withdatetime.now(timezone.utc)Notes
datetime.utcnow()is currently used to set the creation date (global attribute and in file names) in all timeseries_products code, and in ncwriter/imos_template.py