Date Import Formats


The Verity engine can parse a variety of date formats. A single date format can include a calendar format plus an optional time format.

This section contains a table, "Import Date Formats," that presents date formats supported by the Verity parser. These formats can be read, translated, and stored in a collection's documents table.

If you are using mkvdk, use the -datefmt option. If you are developing an application using a Verity API, then you must set the dateInputFormat member in VdkSessionNewArgRec.

Date Import Format Strings

A variety of constructs can be used to define the import date format string.

6-digit and 8-digit numbers are interpreted as having a year, month, and day according to the prevailing datefmt specification, as described in "Numeric Date Formats." If datefmt is not specified, then the engine first tries to interpret 6- and 8-digit numbers in year-month-day order. If that fails, the engine tries to interpret the numbers in month-day-year order.

Table Conventions

Within the Description column of the Date Formats table, shown below, the following constructs describe a date format element. These are representational constructs only. That is, elements such as MM DD YYYY are not actually ever typed in anywhere.

Date Format Element
Description
MM
Represents a one or two-digit numeric month, as 3 or 12.
Mon
Represents an alphabetic month, 3 or more characters in length, as Feb or February.
DD
Represents a one or two-digit numeric day of the month, as 1, 01, or 29.
YYYY
Represents a four-digit numeric year, as 1997.
TIME
Represents a time format, as described under "Time Formats."
DDD
Represents a three-digit numeric Julian day of the year, as 129.

Import Date Formats

Description
Examples
Month-day-year, numeric, American date format (MM DD YY, MM-DD-YY, MM/DD/YY, or MM.DD.YY).
2 17 97
02-17-97
02/17/1997
2.17.1997

Day-month-year, numeric, English format (DD MM YY, DD-MM-YY, DD/MM/YY, or DD.MM.YY).
17 02 97
17-2-97
17/02/1997
17.2.97

Year-month-day, numeric, European date format (YY MM DD, YY-MM-DD, YY/MM/DD, orYY.MM.DD).
97 02 17
97-2-17
1997/2/17
97.2.17

Year-day-month, numeric, Swedish date format (YY DD MM, YY-DD-MM, YY/DD/MM, YY.DD.MM).
97 17 02
97-17-2
97/17/2
97.17.2

Day (numeric), month (alphabetic), year (numeric) (DD Mon YY).
17 Feb 97
17 February 1997

Month (alphabetic), day (numeric), year (numeric) (Mon DD YY).
Feb 17 97
February 17 1997

Month (alphabetic), year (numeric) (Mon YY).
Mar 97
January 95

Month (numeric), year (numeric) (MM YY).
02 97
12 97

Julian Date format (YYDDD).
97364
20001

Any of the preceding, followed with an optional time expression (DD Mon YY TIME); the time can be expressed using any of the time formats described under "Time Formats."
17 Feb 97 23:59
17 February 97 01:50

Dow Jones date format (hh mm DD MM YY)
23 59 25 12 91
00 00 01 01 32

Zulu date format (DDhhmmZ Mon YY); refer to "Zulu Date Format."
252312Z JAN 94
310101Z JAN 94

Zulu Date Format

The Verity engine assumes that the time in Zulu date format is in Greenwich Mean Time (GMT). If you use a different time format when you enter search criteria, local time is assumed. Local time depends on the time and time zone settings of your operating system.

Thus, if you enter the following date as the DATE field value for a document:

252312Z JAN 94

and your computer is set to Pacific Standard Time (PST), a Verity client finds this document if you query the following DATE field value:

Jan 25 94 15:12

This is because PST is 8 hours behind GMT.

Time Formats

Any of the constructs can include an optional time format, as, for example, 02/17/1997 08:55.

The Verity engine understands time formats that have one of the following structures. As in the "Import Date Formats" table, these are representational constructs only. That is, elements such as hh:mm:ss are not actually ever typed in anywhere. You would actually see instead 12:34:56.

hh:mm

hh:mm:ss

hh:mm:ss TIMEOFDAY

hh:mm:ss TIMEOFDAY TIMEZONE

The time format elements are described below.

Time Format Element
Description
hh
This element represents the hours, as 01,1, 11, or 23.
mm
This element represents the minutes, as 01 or 55.
ss
This optional element represents the seconds, as 01 or 55.
TIMEOFDAY
This optional element specifies the 12-hour representation of the time, one of either AM or PM.
TTIMEZONE
This optional element represents a time zone, as PST or EDT.
For example, the Verity engine can import the following combined date and time:

Oct 15 1997 01:33:12 AM PST

Field searches can be performed on dates and times using any of the formats shown in the preceding table.

Numeric Date Formats

The date format constructs described in this section resolve ambiguities in numerical date representations.

By default, dates input into the Documents table are assumed to be in American numeric date format, that is, the month-day-year format (MM-DD-YY). This means that if a user enters a date for a field search query in the same format, the Verity engine can interpret the date and perform the appropriate retrieval. Numeric date formats can be delimited by spaces or slashes in addition to dashes.

If users want to enter date field search criteria in a different format, such as English or European numeric date format, that is, day-month-year or year-month-day, then you must specify to the application which date format to use. If you are using mkvdk, use the -datefmt option. If you are developing your own application, then you must set the dateInputFormat member in VdkSessionNewArgRec.

The datefmt syntax options are listed below.

datefmt syntax
Description
MDY
Represents the month-day-year (MM-DD-YY) numeric format (American format, the default).
DMY
Represents the day-month-year (DD-MM-YY) numeric format (English format).
YMD
Represents the year-month-day (YY-MM-DD) numeric format (European format).
YDM
Represents the year-day-month (YY-DD-MM) numeric format (Swedish format).

Example:

mkvdk -collection collname -bulk -insert filespec -datefmt DMY

The preceding mkvdk command would interpret numeric dates in the format XX-YY-ZZ as DD-MM-YY (day-month-year).





Copyright © 2002, Verity, Inc. All rights reserved.