Previous Topic: Numeric/Text (Picture)Next Topic: Times


Dates

The external data representation of dates can consist of any combination of the component parts of date, or derivatives of these parts. The parts can be in any order, separated by any number of literals. Internally, dates have three components, the 4-digit year, 2-digit month of the year, and 2-digit day of the month. Other components can be derived from these values, including a 2-digit year, century code, week number, day of week number, month name (both abbreviated and long form), day name (both abbreviated and long form), and remainder day number. These components are specified using particular edit pattern picture specifiers, as defined later.

Not all component parts are required to be present in an edit pattern picture. For example, a date edit pattern picture may specify only the month and day. However, the internal representation must always result in a valid date. Therefore, default values must be supplied for all omitted component parts in the edit pattern picture.

The defaults for date edit patterns are defined in the following table.


Component

Edit Pattern Picture Specifier


Default Value

4-digit year

YYYY

Current value, unless ALL of the specified components are zero. If all are zero, the default is zero.

2-digit year

YY

Current value, unless ALL of the specified components are zero. If all are zero, the default is zero, including the century digits.

Century code

C

Current value, unless ALL of the specified components are zero. If all are zero, the default is zero, including the century digits.

Month Number

MM

Current value, unless ALL of the specified components are zero. If all are zero, the default is zero.