This command may be discontinued in a future release. We highly recommend that you no longer use this command. To take advantage of newer Production Reporting functionality, use the datenow function in the LET command.
Retrieves the current date and/or time from the local machine (or from the database for Oracle and some DB2 platforms) and places it in the output file at the specified position or into a column variable.
DATE-TIME position [date_format[col_var]]
position
The position for printing the date.
date_format
A string literal containing the date format mask.
col_var
Places the retrieved date-time into a column variable rather than in the output file.
If col_var is specified, a date_format must be supplied and the current date and time is retrieved each time this command is executed. Otherwise, the date is retrieved only at program start and the same date and/or time is printed each time.
If a date_format is not specified, then the date is returned in the default format for that database.
For some databases, there are two default formats. The first format prints the date-time, as in the following example:
date-time (+1,1)
The second format retrieves the date-time into a column variable, as follows:
date-time () '' &date1
Obviously, for those databases with only one default format, that format is always used in either of these cases.
For information on the valid edit mask format codes, see Table 52, Miscellaneous Functions.