You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 1, 2022. It is now read-only.
I've encountered multiple NetCDF files where the date is truncated by a second in DateUnit.makeStandardDateString(double). The implementation in 4.6.16.1 results in a date string with second precision, but I believe the date is only truncated by a millisecond.
i.e. secs = 89999.999999999985 is incorrectly rounded down to 89999999 milliseconds.
see /cdm/core/src/main/java/ucar/nc2/units/DateUnit.java
getDate (line 191)
makeDate (line 213): return new Date(getDateOrigin().getTime() + (long) (1000 * secs));
Rounding prior to casting should solve the issue. Something like: return new Date(getDateOrigin().getTime() + (long) Math.Round(1000 * secs));