Previous Topic: Picture (Numeric/Character)Next Topic: Time


Date

Date editing accepts many different specifiers to indicate different portions of a formatted date value, such as the century, year, month, name of the month in the current calendar. The specifiers can be used in any combination, and in any order. Also, specifiers can be intermixed with any literal characters in order to provide the necessary punctuation.

The following table lists all of the date edit format specifiers.

Specifier

Description

YYYY

The century and year, formatted as a four-digit value, ranging from 0001 to 9999 for date variables and from 1600 to 2599 for numeric variables, or 0000 for both when all other components are also zero.

YY

The year of the century, formatted as a two-digit value, from 01 to 99 for either date or numeric variables, or 00 when all other components are also zero.

C

Century number, specified as a one-digit value, from 0 to 9.

MM

Current month number of the year, based on the current calendar. The number may be from 01 to 12 for Gregorian, or 00 when all other components are also zero.

MN

The full name of the month for the current calendar. This component results in a varying length value, corresponding to the name of the month. For example, MN DD YYYY displays July 4, 2000 for 7/4/00, and August 4, 2000 for 8/4/00.

MA

The abbreviation of the month name for the current calendar, if an abbreviation is allowed. If not allowed, the full month name is used. This component results in a varying length value.

DN

The full name of the day of the week for the current calendar. This component results in a varying length value, corresponding to the name of the day of the week.

DA

The abbreviation of the name of the day for the current calendar, if an abbreviation is allowed. If not allowed, the full month name is used. This component results in a varying length value.

JJJ

This is the sequence number of the day in the year. It is based on the current calendar for the date being edited. For Gregorian, the first day of each year is January 1, and the specifier is the sequence of days since the first of January.

Note: January 1 is sequence number 1.

RRR

The sequence number indicating the number of days remaining in the current calendar.

CAL

The full name of the current calendar. This component results in a varying length result.

In some cases, more than one specifier can be used to specify the same portion of the internal date. For example, the specifier JJJ represents the day sequence number from the start of the year. This value actually implies the month and day of the month within the year. If JJJ is used in an edit pattern as well as either the month and/or day of the month, then an overlapping condition exists. In this case, output editing synchronizes the values. For input editing, however, these overlaps can be a cause for concern.