dateFormat

The dateFormat property identifies the format for dates.

Valid values are as follows:
"pattern"
The value of pattern consists of a set of characters, as described in Date, time, and timestamp format specifiers.

Characters may be dropped from the beginning or end of a complete date specification, but not from the middle.

defaultDateFormat
If specified for a page field, the value of defaultDateFormat is the date format given in the runtime Java™ locale. If specified for a form field, the default pattern is equivalent to selecting systemGregorianDateFormat.
eurDateFormat
The pattern "dd.MM.yyyy", which is the IBM® European standard date format.
isoDateFormat
The pattern "yyyy-MM-dd", which is the date format specified by the International Standards Organization (ISO).
jisDateFormat
The pattern "yyyy-MM-dd", which is the Japanese Industrial Standard date format.
usaDateFormat
The pattern "MM/dd/yyyy", which is the IBM USA standard date format.
systemGregorianDateFormat
An 8- or 10-character pattern that includes dd (for numeric day), MM (for numeric month), and yy or yyyy (for numeric year), with characters other than d, M, y, or digits used as separators.
The format is in this Java runtime property:
  vgj.datemask.gregorian.long.NLS
NLS
The NLS (national language support) code that is specified in the Java runtime property vgj.nls.code. The code is one of those listed in targetNLS. Uppercase English (code ENP) is not supported.

For additional details on vgj.nls.code, see Java runtime properties (details).

systemJulianDateFormat
A 6- or 8-character pattern that includes DDD (for numeric day) and yy or yyyy (for numeric year), with characters other than D, y, or digits used as separators.
The format is in this Java runtime property:
  vgj.datemask.julian.long.NLS
NLS
The NLS (national language support) code that is specified in the Java runtime property vgj.nls.code. The code is one of those listed in targetNLS. Uppercase English (code ENP) is not supported.

For additional details on vgj.nls.code, see Java runtime properties (details).

The property is available in DataItem parts and is meaningful for fields that appear in the following contexts:
This property is used for both input and output, but not in the following cases:

Internal date formats

When the user enters valid data, the date is converted from the format specified for the field to an internal format that is used for subsequent validation.

The internal format for a character date is the same as the system default format and includes separator characters.

For a numeric date, the internal formats are as follows:
  • For a Gregorian short date, 00yyMMdd
  • For a Gregorian long date, 00yyyyMMdd
  • For a Julian short date, 0yyDDD
  • For a Julian long date, 0yyyyDDD

Length considerations for dates

In a form, the field length on the form must be greater than or equal to the length of the field mask that you specify. The length of the field must be long enough to hold the internal format of the date.

In a page field, the rules are as follows:
  • The field length must be sufficient for the date mask you specify but can be longer
  • In the case of a numeric field, the separator characters are excluded from the length calculation.

Examples are in the next table.

Format type Example Length of form field Minimum length of page field (character type) Valid length of page field (numeric type)
Short Gregorian yy/MM/dd 8 8 6
Long Gregorian yyyy/MM/dd 10 10 8
Short Julian DDD-yy 6 6 5
Long Julian DDD-yyyy 8 8 7

I/O considerations for dates

Data entered into a variable field is checked to ensure that the date was entered in the format specified. The user does not need to enter the leading zeros for days and months, but can specify (for example) 8/5/1996 instead of 08/05/1996. The user who omits the separator characters, however, must enter all leading zeros.

Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.