Z39.50 Date/Time Definition

April 6, 1998
February 17, 1999: minor syntax error corrected -- Z3950Date:flags:era was defined as "IMPLICIT CHOICE". "IMPLICIT" was removed.


Representation of date and time in Z39.50 has been awkward at best, and the mechanisms commonly used have some serious deficiencies, notably: ASN.1 type GeneralizedTime, used in Z39.50 retrieval schemas, does not support representation of just a date (the "time" component is mandatory), or for a date, just a year. And the definition of GeneralizedTime is based on ISO standards that apparently have been withdrawn (ISO 2014 and 3307).

The definition below is a structured definition, not to preclude the possibility of also developing a string definition. No proposal has been put forth (for Z39.50) for a date/time string definition. If and when there is such a proposal, it would most likely be based on ISO 8601 syntax (and would be aligned with the ISO 8601 profile currently being developed within the Dublin Core group) and take the form:

        ISO8601DateTime ::= InternationalString
              -- Where the syntax of the string, and the semantics 
              -- are described via ASN.1 comments.

This definition addresses the syntax of date/time representations, not "role" issues such as how to represent the type of date, e.g. date of publication, date of creation, etc. The definition is not intended to replace usage of GeneralizedTime within existing Z39.50 ASN.1 definitions; it is intended for new definitions.

ASN.1 Definition

{Z39-50-userInfoFormat dateTime (6)} DEFINITIONS ::=
IMPORTS IntUnit FROM Z39.50-APDU-1995;

DateTime ::= SEQUENCE{
     date [1]  Z3950Date OPTIONAL,
     time [2]  Z3950Time OPTIONAL
                    -- one or the other, or both

Z3950Date ::= SEQUENCE{
 year         [1] IMPLICIT INTEGER,
                    -- For "positive" years, i.e. 1 AD or later, supply
                    -- the absolute year, e.g. If the year is 1995, supply
                    -- the integer 1995; the value 95 would indicate the
                    -- year 0095.
                    -- For "negative" years, e.g. 1 BC or earlier, -1
                    -- represents 1 BC, -2 represents 2 BC, etc. Zero is
                    -- invalid, because there was no year zero.
 partOfYear   [2] CHOICE{ -- may be omitted if only year is significant
        monthAndDay [1]   IMPLICIT SEQUENCE{
                       month [2]  IMPLICIT INTEGER, 
                                   -- value 1-12
                       day   [3]  IMPLICIT INTEGER OPTIONAL
                                   -- may be omitted if only year and month
                                   -- are significant. Value 1-31.
        julianDay   [2]   IMPLICIT INTEGER, -- Value 1 - 366.
        weekNumber  [3]   IMPLICIT INTEGER, -- Value 1 - 53. 
        quarter     [4] CHOICE{
                       first    [1] IMPLICIT NULL,
                       second   [2] IMPLICIT NULL,
                       third    [3] IMPLICIT NULL,
                       fourth   [4] IMPLICIT NULL},
        season      [5] CHOICE{
                       winter   [1] IMPLICIT NULL,
                       spring   [2] IMPLICIT NULL,
                       summer   [3] IMPLICIT NULL,
                       autumn   [4] IMPLICIT NULL}
                                              } OPTIONAL, 
 flags        [3] IMPLICIT SEQUENCE{
     circa          [1]   IMPLICIT NULL OPTIONAL,
                          -- if this flag is set then the date is "approximate".
     era            [2]   CHOICE{
                          -- If era occurs, partOfYear should not occur.
                          decade         [1] IMPLICIT NULL,
                                              -- year must be multiple of 10.
                                              -- For example, 1900 refers to
                                              -- the decade covering the years
                                              -- 1900 through 1909.
                          century        [2] IMPLICIT NULL,
                                              -- year must be multiple of 100.
                          millennium     [3] IMPLICIT NULL
                                              -- year must be multiple of 1000.
                                                    } OPTIONAL
                                              } OPTIONAL

Z3950Time ::= SEQUENCE{
     hour           [1] IMPLICIT INTEGER,
                             -- Value 0-23. 
     minute         [2]  IMPLICIT INTEGER OPTIONAL,
                             -- value 0-59. May be omitted when hour only is
                             -- significant (in which case second and
                             -- partOfSecond must also be omitted). 
     second         [3]  IMPLICIT INTEGER OPTIONAL,
                             -- value 0-59. May be omitted when only hour, or
                             -- hour and minute, is significant (in which case
                             -- partOfSecond must also be omitted).
     partOfSecond   [4]  IMPLICIT IntUnit OPTIONAL,
                             -- Use Unit System = 'si', Unit type = 'time'; 
                             -- Unit = 'second', with appropriate value and
                             -- scale factor.
     zone           [5]  CHOICE{
                              local      [1]  IMPLICIT NULL,
                              utc        [2]  IMPLICIT NULL,
                              utcOffset  [3]  IMPLICIT INTEGER  -- in minutes

Library of Congress