dateTime property

mdex:dateTime properties represents a single point in time.

An mdex:dateTime property represents the year, month, day, hour, minute, and seconds of a time point, with the optional specification of fractional seconds. You can specify a datetime value as either a universal (UTC) date time or as a local time plus a UTC timezone offset. Note that specifying just a local time is not supported.

format for universal datetime

The mdex:dateTime format for a UTC date time is:
yyyy '-' mm '-' dd 'T' hh ':' mm ':' ss {'.' s+} Z
where:
  • yyyy represents a four-digit year. The year value may not be negative, which means that specifying a year prior to 1 BCE is not supported. Year 0000 is not a valid year.
  • The first mm is a two-digit numeral that represents the month. Numerals representing the first nine months must have a leading zero, such as 07 for July.
  • dd is a two-digit numeral that represents the day of the month, such as 03 for the third day of the month or 30 for the thirtieth day.
  • T is a literal separator indicating that time-of-day follows.
  • hh is a two-digit numeral that represents the hour. Note that specifying 24 is not permitted (to represent 24, use all zeros for the time portion).
  • The second mm is a two-digit numeral that represents the minute.
  • ss is a two-digit numeral that represents the whole seconds.
  • '.' s+ is optional and, if present, represents the fractional seconds. The internal representation is only precise to the millisecond, which means that a specification of four or more digits is truncated to three digits.
  • Z (added to the time without a space) is a literal indicator that this date time is Coordinated Universal Time (UTC, sometimes called Greenwich Mean Time). Z is the zone designator for the zero UTC offset.

Note that a hyphen ('-') is the separator between parts of the date portion, a colon (':') is the separator between parts of the time-of-day portion, and a period ('.') is the separator for fractional seconds.

For example, to indicate noon on November 18, 2010 in New York City, you would specify:
2010-11-18T17:00:00Z

format for local time plus UTC offset

Alternatively, you can specify the value for an mdex:dateTime property as a local time plus a UTC offset. The format for this representation is:
yyyy '-' mm '-' dd 'T' hh ':' mm ':' ss {'.' s+} zzzzzz

The meanings of the date and time portions are the same as the universal datetime format. zzzzzz represents the timezone. Timezones are durations of hours and minutes. Timezones may be specified as positive or negative durations.

The format for a timezone is:
('+' | '-') hh ':' mm
where:
  • hh is a two-digit numeral (with leading zeros as required) that represents the hours. The value for hh cannot be greater than 14.
  • mm is a two-digit numeral that represents the minutes. The value for mm cannot be greater than 59. However, if hh is 14, then mm must be 00.
  • '+' indicates a non-negative duration.
  • '-' indicates a non-positive duration.
For example, to indicate noon on November 18, 2010 in New York City, you would specify:
2010-11-18T12:00:00+05:00

Note that this time represented in this example is the same as the "2010-11-18T17:00:00Z" time in the universal datetime format.

Example of ingesting dateTime properties

The following request updates Record 506 with two dateTime properties:
<ingest:ingestRecords 
      xmlns:ingest="http://www.endeca.com/MDEX/ingest/1/0" 
      xmlns:mdex="http://www.endeca.com/MDEX/XQuery/2009/09">
   <ingest:addAssignments>
      <mdex:record>
         <FactSalesID>506</FactSalesID>
         <dT1 type="mdex:dateTime">2010-11-18T17:00:00Z</dT1>
         <dT2 type="mdex:dateTime">2010-11-18T12:00:00+05:00</dT2>
      </mdex:record>
   </ingest:addAssignments>
</ingest:ingestRecords>

The dT1 property uses the universal datetime format while the dT2 property specifies the datetime as a local time plus a UTC offset.