Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

Time

Joe Fahle (jhf@seaspace.com)
Thu, 13 Jan 94 10:07:27 PST

In response to Eric Pepke's mail ...

Here, for better or for worse, we have used the following pair
of units to parameterize time

std_date - days since Jan 1, 1990, inclusive
std_time - seconds of the day (either as a long, float, double)

We are in the satellite business, so we pretty much stick to GMT.

"std_date" and "std_time" are not variable names; they are units.

We use these units to determine print format. We always print
dates as yy/mm/dd and time as hh:mm:ss.sss . If users every want
different print formats, that really is a job for preferences
(e.g., the UNIX environment variable TZ) .

The instant we import data, we try to get any date and time variables
into "std_date" and "std_time" units. Similarly, when we export data
(or print it), we try to put it into a friendlier form.

We have lived (and died) with this decision for about 7-8 years.

We never have regretted keeping dates and times in GMT. We have
had mixed feeling about 'days since Jan 1, 1990'. This idea came
from Informix. Days since Jan 1, 1970 would have been more UNIXy.

What might have been even better would be (fractional) days since
1/1/1970 (or 1/1/1900) as a double precision value.

In any case, we really like the ability to trivially difference
(date,time) pairs, e.g. diff = (date1-date2)*86400 + (time1-time2)
in seconds.

Hope this is useful ...
Joe Fahle

 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Office of Programs University Corporation for Atmospheric Research (UCAR)   Unidata is a member of the UCAR Office of Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690