Formatting Dates and Times

Conversion codes can be used to specify formatting for dates and times. Dates and times are normally stored in internal format, an integer value that is much easier for processing and storage. In order to output this type of numeric data, it must be converted into a specified format. Two examples from the ORDERS file are shown below:

Item-ID

DATE

TIME

D/CODE

A

A

A/AMC

2

7

S/NAME

Date of Order

Time of Order

S/AMC

 

 

V/CONV

D2/

MTHS

V/CORR

 

 

V/TYP

L

L

V/MAX

10

10

Dates are formatted using two digits for the year and a slash character (/) as a delimiter. For example:

04/13/88

Times are formatted using the 12-hour format with AM or PM appended, and include seconds. For example:

09:13:56AM

See Also

MX and MY Codes

Stored Format and Output Format

Formatting Dollar Amounts