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

Wrong times reported by "ncdump -t" #1864

Closed
rkouznetsov opened this issue Oct 14, 2020 · 4 comments · Fixed by #1866 or #1868
Closed

Wrong times reported by "ncdump -t" #1864

rkouznetsov opened this issue Oct 14, 2020 · 4 comments · Fixed by #1866 or #1868
Labels

Comments

@rkouznetsov
Copy link
Contributor

Reproducible with ncdump from

  • netcdf library version 4.7.1 of Aug 31 2019 00:57:34
  • netcdf library version 4.7.3 of Jan 23 2020 04:18:16

timebug.nc.gz

ncdump -t timebug.nc

reports times starting from midnight, while the first time is at 07Z.
Thank you!

@lesserwhirls
Copy link
Contributor

I believe this is a duplicate of #1417.

@rkouznetsov
Copy link
Contributor Author

Thank you! I would guess, it is not a duplicate, although, might be related. That one was caused by undesired conversion of UTC to local time. This one is about ignoring the time specification..

@lesserwhirls
Copy link
Contributor

ncdump -t does not attempt to handle the time zone at all. I think the bug is that when the unit attribute parsing code encounters UTC, it sets the clock time to zero by mistake rather than simply dropping the timezone. See this comment (which appears to have a fix as well).

And now I see you had been involved in the conversation over on that issue - sorry about the duplicate info here!

I was able to take your example file and 1. drop UTC from the units string and get correct results (e.g. minutes since 2018-01-03 07:00:00), and 2. change UTC to MDT (or other string, e.g. minutes since 2018-01-03 07:00:00 ABCDEFG) and get correct results. I only see the bug when UTC is used.

@rkouznetsov
Copy link
Contributor Author

Thank you! That report was also from me :), and I got an impression that it been closed already, so did not check it. Sorry. So it is the same bug. So far I have just forced 00Z for all reference times as a workaround...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants