-
Notifications
You must be signed in to change notification settings - Fork 262
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
Issue printing date string #1417
Comments
Is this related to e-support WSC-538180? |
It is not related. WSC-538180 is about printing time string when number of seconds is a tiny amount smaller than 60. The current issue is a coarse error of 3 hours. |
I can reproduce this behavior with ncdump in the current version, 4.7.0. I made a second test file using the reporter's data values, and a current 4.7.0 version of ncgen. The incorrect behavior remains exactly the same, in the context of several differences:
|
Okay, this is related to the units string and its time zone indicator. If you make this change: I am not familiar with the proper behavior of the time zone modifiers, or the default time zone assumption. Can anyone else comment on this? |
The original reporter asked "Or is there something non-standard in the way the time dimension |
Thank you for the responses and sorry for long silence. Removing UTC would be a workaround, although, I would like to have that UTC mark clearly indicating the absolute time of the time satmps. Ideal resolution to my view would be to arrange timezone-aware printing at least for Zulu time in case the timezone explicitly specified: |
It turns out this is a parser bug, not a simple timezone problem. With "UTC" at the end of the unit string, your initial time of day Here is a bug fix for |
The answer for "I am not familiar with the proper behavior of the time zone modifiers" is that the time zone suffix is always ignored by ncdump -t. Current behavior is to interpret time coordinates based only on the date and time of day in the units string. No time zone offset is ever applied. The current bug is an unintended exception. Another way of saying this is that if your base units include a time zone, then the dates and times from ncdump -t will also be in the same time zone, except no suffix is ever printed. |
It should be pretty easy to copy the identical suffix from the base unit string to printed dates and times. Today I was focused on the bug fix, and I did not think about changing the printing. |
Ward - Did Dave's fix ever get incorporated? |
@DennisHeimbigner @WardF, this fix is not in current master (2020 October 14), and I do not see a PR for it. I am ready to push a new PR from my remote machine, but I am getting error 403 from As said before, my current change fixes the parser bug (and the misinterpreted time zone), but does not address the other request to add printed time zones to |
Hi Dave, the standard process is to fork the repository, incorporate your changes into the forked repo, and then issue a pull request (PR). Adding write/push access outside of the organization isn't something I'm able to enable. |
For future reference, here is a summary of the date string parser bug. Affected versions are netcdf-c 4.2.0 through 4.7.4 (currently). This affects time unit strings that include both the optional time-of-day field, and the optional time zone field. In 4.2.0, support was added for the ISO 8601 upper-case "T" separator between the date and time-of-day, in place of the UDUNITS traditional space separator. Consider two examples, traditional and ISO 8601:
The original parser code did not anticipate the first case including the optional time zone. It gave priority to the first upper-case "T", rather than a space following the date. Therefore, any time zone suffix containing upper-case "T" triggered the bug. UTC, EST, EDT, whatever. Note this only happens when there is a space separator between date and time, followed by a time zone containing upper-case "T". The date string was then parsed incorrectly as follows.
Also notice that when time-of-day substring is The bug fix treats both space and upper-case "T" with equal priority, immediately following the date substring. |
Thanks, @Dave-Allured. Good to know that has been fixed. |
The following issue was reported to us. Using the attached file, we see that the printout is assuming the starting offset is from 00:00:00UTC, when it should be from 03:00:00UTC
Issue as reported
ncdump -t on the attached file prints timestamps starting with
"2018-03-01 21", whereas it should be "2018-03-02".
ncdump is from netcdf library coming with Ubuntu 16.04.
(version 4.4.0 of Mar 29 2016 11:41:40)
Could you please check if the issue is reproducible in the current version?
Or is there something non-standard in the way the time dimension
specified in the file?
cdo and panoply are perfectly capable to interpret such time axis
right.
The text was updated successfully, but these errors were encountered: