Previous Topic: &CURSCOL and &CURSROW

Next Topic: &DAY


&DATEn

This is a set of system variables which provide different formats of the current system date.

&DATE1 to &DATE17 (excluding &DATE15) supply the current system date in a variety of formats, as listed below:

where:

DAY

Is the day of the week as follows:

DD

The day of the month as a 2-digit number

DDD

The Julian day within the year as a 3-digit number

MM

The month of the year as a 2-digit number

MON

The month of the year as follows:

nnnnnn

The number of days from 1 January 0001 with no leading zeros

YYYY

The current year as a 4-digit number

YY

The current year as a 2-digit number

p

Plus or minus relative to Greenwich Mean Time (GMT)

FFFFFF

The time accurate to 10-6

HHMMSS

The current time

HHMM

The GMT offset

Examples: &DATEn

&IF &DATE1 GT 98.001 &THEN +
 &END
&WRITE DATA=TODAY'S DATE IS &DATE2
&TODAY = &SUBSTR &DATE3 1 6 
&IF &TODAY EQ 25-DEC &THEN +
    &GOTO .XMASDAY

Notes:

The current day is provided in the system variable &DAY.

&DATE6, &DATE7, &DATE8, and &DATE9 are useful where records are to be stored in chronological order.

See the &DATECONV function for the rules that apply to choice of century when converting from a form of the date that expresses the year in two digits (YY) to the form of the year in four digits (YYYY).

Each access to &DATE11 causes the system to re-fetch and synchronize time with the operating system, to format the result to microsecond accuracy. Use of this time should be avoided, to reduce unnecessary overheads, if such accuracy is not required.

More information:

&ZGDAY