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.

Syntax: How to Retrieve the Current Date

TODAY(output)

where:

output

Alphanumeric, at least A8

The following apply:

  • If the format is A8 or A9, TODAY returns the 2-digit year.
  • If the format is A10 or greater, TODAY returns the 4-digit year.

Example: Retrieving the Current Date

WebFOCUS

Feedback