TODAY: Returning the Current Date

How to:

The TODAY function retrieves the current date from the operating system in the format MM/DD/YY or MM/DD/YYYY. It always returns a date that is current. Therefore, if you are running an application late at night, use TODAY. You can remove the default embedded slashes with the EDIT function.

You can also retrieve the date in the same format (separated by slashes) using the Dialogue Manager system variable &DATE. You can retrieve the date without the slashes using the system variables &YMD, &MDY, and &DMY. The system variable &DATEfmt retrieves the date in a specified format.


Top of page

x
Syntax: How to Retrieve the Current Date
TODAY(output)

where:

output

Alphanumeric, at least A8

The following apply:

  • If DATEFNS=ON and the format is A8 or A9, TODAY returns the 2-digit year.
  • If DATEFNS=ON and the format is A10 or greater, TODAY returns the 4-digit year.
  • If DATEFNS=OFF, TODAY returns the 2-digit year, regardless of the format of output.


Example: Retrieving the Current Date

TODAY retrieves the current date and stores it in a column with the format A10.

TODAY('A10')

iWay Software