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.
Ajit, > It appears I was setting UDUNITS2_XML_PATH to the folder location and not the > actual filename. > Thank you for pointing that out! > > My local udunits2 and udunits-1 tests from the samples appear to pass now. Good. > (1) > With udunits-1, I can do this… > utUnit unit; > utIni(&unit); > utScan("days since 1895-01-01", &unit); > utCalendar(val, &unit, &year, &month, &day, &hour, &minute, &second); > > How can I achieve the same using udunits2? The package has documentation in HTML pages, which should have been installed by CMake. You can also view it at <http://www.unidata.ucar.edu/software/udunits/udunits-2.2.24/doc/udunits/udunits2.html>. In general, you obtain a well-known unit via the function ut_parse(). That takes care of your first 3 items. Converting a time-value to years, months, days, etc. is done with the function ut_decode_time(). > (2) > Does udunits-1 allow me to define and use a specific locale like udunits2 > does using utEncoding? Sorry, no. Regards, Steve Emmerson Ticket Details =================== Ticket ID: MZK-350035 Department: Support UDUNITS Priority: Normal Status: Closed =================== NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.