Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect use of datetime.utcnow() to set date_created attributes #125

Open
mhidas opened this issue Jun 17, 2020 · 1 comment
Open

Incorrect use of datetime.utcnow() to set date_created attributes #125

mhidas opened this issue Jun 17, 2020 · 1 comment
Labels
bug Something isn't working ncwriter Related to creating netCDF files based on templates
Milestone

Comments

@mhidas
Copy link
Contributor

mhidas commented Jun 17, 2020

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.

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

@mhidas mhidas added bug Something isn't working ncwriter Related to creating netCDF files based on templates aggregated_timeseries Issues relating to the aggregated time series product hourly_timeseries Issues relating to the hourly time series product gridded_timeseries Issues relating to the gridded time series product velocity_aggregated Issues relating to the velocity aggregated time series product velocity_hourly Issues relating to the velocity hourly time series product labels Jun 17, 2020
@mhidas mhidas added this to the v1.5 Timeseries products milestone Jun 6, 2022
mhidas added a commit that referenced this issue Jun 9, 2022
@mhidas
Copy link
Contributor Author

mhidas commented Jun 14, 2022

This has been fixed for timeseries_products.
For ncwriter there was also an update required in the unittests, and an additional issue with Python 3.5 - so I've left this for later.

@mhidas mhidas removed aggregated_timeseries Issues relating to the aggregated time series product hourly_timeseries Issues relating to the hourly time series product gridded_timeseries Issues relating to the gridded time series product velocity_aggregated Issues relating to the velocity aggregated time series product velocity_hourly Issues relating to the velocity hourly time series product labels Jun 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ncwriter Related to creating netCDF files based on templates
Projects
None yet
Development

No branches or pull requests

1 participant