Date and time formats and patterns

Date and time indexes can be adapted to several languages and regions. TEXTML Server formats are based on the International Component for Unicode (ICU) and ISO 8601 standards.

To specify a date or a time format, use the <format> element and specify the appropriate language locale in its NAME attribute. For example, to index American English dates and French dates in a docbase, you would define your index as follows:

<index NAME = "MyDateIndex"> 
   <dateindex> 
      <dateindexproperties> 
         <datevalidation VALUE="YearMonthDay"/> 
         <formats> 
            <format NAME="en_US"/> 
            <format NAME="fr_FR/> 
         </formats> 
      </dateindexproperties> 
   </dateindex> 
</index>

When you specify a locale in date and time indexes, TEXTML Server parses the documents for all the patterns allowed. Once a pattern is recognized, the date or the time is indexed.

About Patterns

Table 1 lists the symbols used in the date and time format patterns.

Table 1. Date and time symbols
Date and time entity Symbol Example
Year yy or yyyy MM/dd/yy = 06/18/12
MM/dd/yyyy = 06/18/2012
Month M, MM, MMM, MMMM or MMMMM M = 1
MM = 01
MMM = Jan
MMMM = January
MMMMM = J
Day of the month d (numerical) or dd (with padded single digits) d = 5
dd = 05
Week in a year w (numerical) or ww (single digit padded) w = 5, 27; ww = 05, 27
Week in month W 4
Time
  • H hour in day (0 to 23)
  • h hour in am/pm (1-12)
  • mm (minutes)
  • ss (seconds)
  • a (am/pm marker)
H:mm:ss = 14:35:30

h:mm a = 2:35 PM

Day of the week
  • EEE (abbreviated)
  • EEEE (spelled out)
  • EEE, MMM dd, yy= Tue, Jun 18, 12
  • EEEE, MMMM d, yyyy= Tuesday, June 18, 2002
Note: The complete list of patterns is available in the DATETIME_FORMATS.XML document.