Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

DATE( ) Output date

&pagelevel(3)&pagelevel

Domain: Environment information (calendar)

The DATE( ) function determines the current date and returns it in the specified format.

Format

DATE( )

FORMAT = *ISO / *AMERICAN / *GERMAN

,MODE = *LOCAL-TIME / *UNIVERSAL-TIME

Result type

STRING (<string 10..13>)

Input parameters

FORMAT = *ISO / *AMERICAN / *GERMAN
Specifies the format in which the date is output.

MODE = *LOCAL-TIME / *UNIVERSAL-TIME
Determines if the date is output in the local time (LOCAL-TIME) or in universal time (UNIVERSAL-TIME).
See also the GTIME macro in the “Executive Macros” manual [7] for more information on LOCAL-TIME (LT) and UNIVERSAL-TIME (UTC).

Result

Input parameter FORMAT =

Date format <string 10..13>

*AMERICAN

mm/dd/yyiii

*ISO

yyyy-mm-ddiii

*GERMAN

dd.mm.yyyy

iii
yy
yyyy
mm
dd

Day in current year (001 .. 366)
Two-digit year number
Complete year number
Two-digit month number (01 .. 12)
Day in current month (01 .. 31)
                                                                                                        

Error messages

No error messages

Example

/G = DATE(FORMAT = *GERMAN)
/SHOW-VARIABLE G
G = 16.04.2007

/A = DATE(FORMAT = *AMERICAN)
/SHOW-VARIABLE A
A = 04/16/07106

/I = DATE( )
/SHOW-VARIABLE I
I = 2007-04-16106

April 16th is the 106th day of the year 2007, which is why the representation of the date in the ISO format and in the American format contains the suffix 106.