This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Mary, > Date: Thu, 14 Oct 2004 10:01:23 -0600 (MDT) > From: Mary Haley <address@hidden> > To: address@hidden > Cc: address@hidden > Subject: Bug in ut_calendar? The above message contained the following: > I think we have discovered a bug in utCalendar that surfaces on > Solaris and AIX, but not RedHat Linux. I've attached a small C program > that illustrates the problem. Basically, with a units of "months > since 1870-1-1", you'd expect a time of 0 to return: > > year = 1870 > month = 1 > day = 1 > hour = 0 > second= 0 > > But instead we're getting: > > year = 1869 > month = 12 > day = 31 > hour = 23 > second= 59 I suspect that your program would actually print "second= 60". It did on my system. > The program works if you replace "1870" with either "1869" or "1871". > I verified that this problem exists in the latest version of > Udunits (1.12.2). > > Thanks for your time, Thanks for reporting this. The problem is one of formatting a time-unit; conversion between different time-units should work correctly. I've created a new release (1.12.3) that doesn't have this problem. You can obtain it at ftp://ftp.unidata.ucar.edu/pub/udunits/udunits-1.12.3.tar.Z Regards, Steve Emmerson