an EML question

Matt Jones jones at nceas.ucsb.edu
Thu Jan 13 10:21:01 PST 2005


Hi Eda,

If I'm interpreting things correctly, then I think it should probably be 
'datetime' with the appropriate format string. My guess is that your 
format string would probably be 'hhmm'.  Attached below is the 
explanation from the EML specification which should help to clarify.

Cheers,
Matt

DateTime documentation from the EML 2.0.1 Specification
-------------------------------------------------------
This field is used for defining the characteristics of this attribute
if it contains date and time values. Datetime is used when the values
fall on the Gregorian calendar system.  Datetime values are special
because the have properties of interval values (most of the time it
is legitimate to treat them as interval values by converting them
to a duration from a fixed point) but they sometimes only behave
as ordinals (because the calendar is not predetermined, for some
datetime values one can only find out the order of the points and
not the magnitude of the duration between those points).  Thus,
the datetime scale provides the information necessary to properly
understand and parse date and time values without improperly labeling
them under one of the more traditional scales.

A format string that describes the format for a date-time value from
the Gregorian calendar.  Datetime values should be expressed in a
format that conforms to the ISO 8601 standard.  This field allows
one to specify the format string that should be used to decode
the date or time value.  To describe the format of an attribute
containing date-time values, construct a string representation of
the format using the following symbols:

   Y   year
   M   month
   W   month abbreviation (e.g., JAN)
   D   day
   h   hour
   m   minute
   s   second
   T   time designator (demarcates date and time parts of date-time)
   Z   UTC designator, indicating value is in UTC time
   .   indicates a decimal fraction of a unit
   +/- indicates a positive or negative number,
       or a positive or negative time zone adjustment relative to UTC
   -   indicates a separator between date components
   A/P am or pm designator


Any other character in the format string is interpreted as a
separator character.  Here are some examples of the format strings
that can be constructed.

                   Format string          Example value
                   -------------------    ------------------
    ISO Date       YYYY-MM-DD             2002-10-14
    ISO Datetime   YYYY-MM-DDThh:mm:ss    2002-10-14T09:13:45
    ISO Time       hh:mm:ss               17:13:45
    ISO Time       hh:mm:ss.sss           09:13:45.432
    ISO Time       hh:mm.mm               09:13.42
    Non-standard   DD/MM/YYYY             14/10/2002
    Non-standard   MM/DD/YYYY             10/14/2002
    Non-standard   MM/DD/YY               10/14/02
    Non-standard   YYYY-WWW-DD            2002-OCT-14
    Non-standard   YYYYWWWDD              2002OCT14
    Non-standard   YYYY-MM-DD hh:mm:ss    2002-10-14 09:13:45

Some notes about these examples.  First, the ISO 8601 standard is
strict about the order of date components and the separators that
are legal.  Best practice is to follow the ISO 8601 format precisely.
However, we recognize that existing data contain non-standard dates,
and existing equipment (e.g., sensors) may still be producing
non-standard dates.  Consequently, we have provided the formatting
string with additional characters to describe the date formats. In
particular note that the use of a slash (/) to separate date
components, a space to separate date and time components, using
a twelve-hour time with am/pm designator, and placing any of the
components out of descending order is non-standard according to ISO.
Nevertheless, these formats can be described using the format string
to accommodate existing data.

Decimal date-time values can be extended by indicating in the format
that additional decimals can be used.  Only the final unit (e.g.,
seconds in a time value) can use the extended digits according to
the ISO 8601 standard.  For example, to show indicate that seconds
are represented to the nearest 1/1000 of a second, the format string
would be "hh:mm:ss.sss".  Note that this only indicates the number
of decimals used to record the value, and not the precision of the
measurement (see dateTimePrecision for that).

Date/time values are from an interval scale, but it is extremely
complex because of the vagaries of the calendar (e.g., leap
years, and leap seconds).  The duration between date-time values
in the future is not even deterministic because leap seconds are
based on current measurements of the earth's orbit. Consequently,
date-time values are unlike any other measured values.  The format
string for date-time values allows one to accurately calculate the
duration in SI second units between two measured date-time values,
assuming that the conversion software has a detailed knowledge of the
Gregorian calendar. Note that this field would not be used if one is
recording time durations.  In that case, one should use a standard
unit such as seconds, nominalMinute or nominalDay, or a customUnit
that defines the unit in terms of its relationship to SI second.

emelend at sunites.upr.clu.edu wrote:
> Matt,
> 
> If I have an attribute that represents the time in a hhmm format, and is saved 
> in my data base as an integer from 0 to 2345, should I classify it as a 
> datetime and give its format, as an interval numberType-natural and specify 
> its boundaries, or ?
> 
> EDA
> 
> -------------------------------------------------
> This mail sent through IMP: http://horde.org/imp/

-- 
-------------------------------------------------------------------
Matt Jones                                     jones at nceas.ucsb.edu
http://www.nceas.ucsb.edu/    Fax: 425-920-2439    Ph: 907-789-0496
National Center for Ecological Analysis and Synthesis (NCEAS)
University of California Santa Barbara
Interested in ecological informatics? http://www.ecoinformatics.org
-------------------------------------------------------------------



More information about the Eml-dev mailing list