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.
Jeremy, >Date: Mon, 18 Apr 2005 13:30:28 -0400 >From: Jeremy Rolph <address@hidden> >Organization: Florida State University >To: Steve Emmerson <address@hidden> >Subject: Re: 20050418: udunits documentation The above message contained the following: > I have since figrued that out. I am, however having a problem using > utcaltime and uticaltime to go from true julian day and milliseconds to > the time convention here at COAPS which is minutes since 1980-1-1 > 000:00:00. If you have any suggestions I would appreciate it. The function julday_to_gregdate() in the UDUNITS library isn't documented, but you could do something like this: int julDay, milliseconds, year, month, day; utUnit unit; /* minutes since 1980-1-1 */ double stdTime; /* minutes since 1980-1-1 */ ... (void)utInit(NULL); (void)utScan("minutes since 1980-1-1", &unit); julday_to_gregdate(julDay, &year, &month, &day); (void)utInvCalendar(year, month, day, 0, 0, milliseconds/1000.0, &unit, &stdTime); ... utTerm(); I'm assuming that the milliseconds is since midnight. > Thanks, > Jeremy Rolph Regards, Steve Emmerson