1.1 Date Format

1.1 Date Format

Old Versus new Date Format

In the old enaio® REST API, formerly known as enaio® appconnector, all date, datetime and time formats are passed as Unix timestamps. These Unix timestamps will still be supported by the native search endpoint. The regular SQL-based search endpoint only accepts date, datetime and time in ISO 8601 format as input format. Unix timestamps are no longer supported.

The enaio® DMS Service always returns date, datetime and time values in the ISO 8601 format. This format is described in the following section.

Introduction to ISO 8601

ISO 8601 is an international standard for date and time specifications. This standard offers recommendations on how to use date and time specifications in an international context as its title "Data elements and interchange formats -- Information interchange -- Representation of dates and times" suggests.

Dates and times according to ISO 8601:1988 are also valid in Germany, Austria and Switzerland due to their integration in
EN 28 601:1992 and DIN 5008.

The standard recommends a consistent notation for dates and times, e.g., using the notation 2004-06-14 for dates, and 23:34:30 for times. Especially in software development and documentation the use of these notations is highly recommended, as country-specific formats carry a high risk of error.

Here are some examples for country-specific notations of 1995-02-04: 4. Februar 1995, 2/4/95, 4/2/95, 95/2/4, 4.2.1995, 04-FEB-1995, 4-February-1995.

The standard defines Monday as the first day of the week. The first week of the year is the first week in January with a Thursday, which results in January 4 always being in the first week. The basis for this is the Gregorian calendar, even for dates in the past up to the year 1582.

Notation

Characters used in the Notation

Y = year
M = month 
D = day
h = hour 
m = minute 
s = second
T = separator between date and time 

Fixed Date and Time Values

In the DMS cloud API, only a part of the ISO 8601 standard is supported, as listed below:

  • Date: YYYY-MM-DD

  • Time: hh:mm:ss

  • Date and time: YYYY-MM-DDThh:mm:ss±hh:mm

When specifying dates and times, a time zone must always be added at the end. In the definition above, this is indicated by the ± symbol, as a time specified can be +02:00 or -02:00, depending on the time zone's offset to UTC.
A partial notation of date and time is currently not supported.

Date and Time Ranges

The DMS API supports queries for date or time ranges as well as queries using the operators greater than, greater than or equal to, less than, and less than or equal to.

  • Date range query: YYYY-MM-DD/YYYY-MM-DD

  • Time range query: hh:mm:ss/hh:mm:ss

  • Date and time range query: YYYY-MM-DDThh:mm:ss±hh:mm/YYYY-MM-DDThh:mm:ss±hh:mm

  • Greater than a date: >YYYY-MM-DD

  • Greater than or equal to a date: >=YYYY-MM-DD

  • Less than a date: <YYYY-MM-DD

  • Less than or equal to a date <=YYYY-MM-DD

  • Greater than a time: >hh:mm:ss

  • Greater than or equal to a time: >=hh:mm:ss

  • Less than a time: <hh:mm:ss

  • Less than or equal to a time: <=hh:mm:ss

  • Greater than a date and time: >YYYY-MM-DDThh:mm:ss±hh:mm

  • Greater than or equal to a date and a time: >=YYYY-MM-DDThh:mm:ss±hh:mm

  • Less than a date and a time: <YYYY-MM-DDThh:mm:ss±hh:mm

  • Less than or equal to a date and a time: <=YYYY-MM-DDThh:mm:ss±hh:mm

Examples

  • Date range query: 2010-02-01/2014-10-24
    Querying a date in the range between 02/01/2010 and 10/24/2014.

  • Time range query: 01:13:52/02:10:00
    Querying a time in the range between 01:13:52 and 02:10:00.

  • Date and time range query: 2010-02-01T01:13:52+02:00/2014-10-24T02:10:00+02:00
    Querying a point in time (date and time) in the range between 02/01/2010 01:13:52 and 10/24/2014 02:10:00 in the time zone UTC+02:00.

  • Greater than a date: >2010-02-01
    Querying a date greater than 02/01/2010.

  • Greater than or equal to a date: >=2010-02-01
    Querying a date greater than or equal to 02/01/2010.

  • Less than a date: <2010-02-01
    Querying a date less than 02/01/2010.

  • Less than or equal to a date: <=2010-02-01
    Querying a date less than or equal to 02/01/2010.

  • Greater than a time: >01:13:52
    Querying a time greater than 01:13:52.

  • Greater than or equal to a time: >=01:13:52
    Querying a time greater than or equal to 01:13:52.

  • Less than a time: <01:13:52
    Querying a time less than 01:13:52.

  • Less than or equal to a time: <=01:13:52
    Querying a time less than or equal to 01:13:52.

  • Greater than a date and time: >2010-02-01T01:13:52-02:00
    Querying a point in time (date and time) greater than 02/01/2010 01:13:52 in the time zone UTC-02:00.

  • Greater than or equal to a date and time: >=2010-02-01T01:13:52-11:00
    Querying a point in time (date and time) greater than or equal to 02/01/2010 01:13:52 in the time zone UTC-11:00.

  • Less than a date and time: <2010-02-01T01:13:52-11:30
    Querying a point in time (date and time) less than 02/01/2010 01:13:52 in the time zone UTC-11:30.

  • Less than or equal to a date and time: <=2010-02-01T01:13:52+00:00
    Querying a point in time (date and time) less than or equal to 02/01/2010 01:13:52 in the time zone UTC.