2010 Unidata NetCDF Workshop > Best Practices
7.7 Calendar Date and Time
Represent calendar dates and times with standards and conventions.
Two conventions for storing a date/time into a netCDF variable are:
- ISO-compliant: as a string using ISO
8601 encoding, such as "2010-10-25T12:00:00Z".
- CF-compliant: as a numeric value and unit that includes the
reference data and time, such as 2116800 "seconds since 2010-10-01
00:00:00".
Unidata's udunits
package provides a convenient way to implement the second
strategy, and the "-t" option to ncdump displays resulting times in
human readable form, close to ISO-8601, e.g. "2010-10-25 12".
Recommendations
- If your data uses real, physical time, encode it as an interval
from a reference time,
and add a udunits-compatible time unit. Readers
can use the udunits package to manipulate or format the date values.
2010 Unidata NetCDF Workshop > Best Practices