Date and Time Formatting

The DATETIME.SQC program provides several procedures to aid in the formatting of date and time values for display in report output. While DATETIME.SQC provides generic procedures for formatting dates and times, the actual format used for date and time values can vary in each report. By default, when printing dates and times, reports use the system-wide default date and time formats that are specified in SETENV.SQC.

During the PeopleSoft installation, you should edit SETENV.SQC to specify the system-wide default format you prefer for date and time values. Edit the following lines in the SETENV.SQC to tell SQR which format you prefer, if it is not otherwise specified in the SQR report source.

#define Year4       '1'             !0 = 2 digit year
#define Prompt-Date mm/dd/yyyy
#define Prompt-Mask 'MDY'
#define DateType    '0'             !iDate 0 = mdy, 1 = dmy 2 = ymd
#define TimeDisplay '1'             !iTime 0 = 12hr, 1 = 24hr

Based on these settings or any overrides, procedures in DATETIME.SQC provide support for various date formats. This table identifies these formats:

SQR Date Format Description

{DEFDMY}

DD/MM/YYYY

{DEFMDY}

MM/DD/YYYY

{DEFKAN}

Japanese Kanji-format dates (using the Japanese Imperial calendar).

{DEFROM}

Japanese Romaji-format dates (using the Japanese Imperial calendar).

The following table includes examples for SQR for PeopleSoft date formats for the date December 14, 2000:

Field or Control Description

14/12/2000

{DEFDMY}

12/14/2000

{DEFMDY}

Date Format button

{DEFKAN}

H.12.12.14

{DEFROM}

For details about how to include date/time formatting in your own SQR reports, refer to the documentation inside the comment block of the DATETIME.SQC SQR include file on your file server. If you plan to use Japanese date formatting in the SQR report, remember to include #define JapaneseDates at the top of the SQR report.