A script-enabled browser is required for this page to function properly.

$$DATE$$ System Variable

Syntax

$$DATE$$

Description

$$DATE$$ retrieves the current operating system date (client-side). Use $$DATE$$ to designate a default value or range for a text item using the Initial Value or Lowest/Highest Allowed Value properties. The text item must be of the CHAR, DATE, or DATETIME data type.

Use $$DATE$$ as a default value for form parameters. In this case, the parameter's value is computed once, at form startup.

Usage Notes

The difference between $$DATE$$ and $$DATETIME$$ is that the time component for $$DATE$$ is always fixed to 00:00:00, compared to $$DATETIME$$, which includes a meaningful time component, such as 09:17:59.

The display of system variables is governed by the format mask, either a default data type format mask or one you specify. For example, to use the default DD-MON-YY format, specify a DATE data type. (Note that the default format mask depends on the value of NLS_LANG.)

Although $$DATE$$ displays only the date, its underlying value includes a time component which is saved at commit time. If you specify a DATETIME data type and provide $$DATE$$ as the default, the underlying value will be DD-MON-YYYY HH:MM:SS: for example, 01-DEC-1994 00:00:00 (although only 01-DEC-1994 will be displayed).

Use $$DATE$$ when you want to compare the contents of this field with a field whose format mask does not have a time component, such as a SHIPDATE field of data type DATE. In this case, both $$DATE$$ and SHIPDATE will have a time component of 00:00:00, so the comparison of two dates evaluating to the same day will be successful.

$$DATE$$ Examples

Example 1

Assume that you want the value of a DATE text item, called ORDERDATE, to default to the current date. When you define the ORDERDATE text item, specify $$DATE$$ in the text item Initial Value property.

Example 2

If you use $$DATE$$ in a parameter, such as :PARAMETER.STARTUP_DATE, then every time you reference that parameter, the date you started the application will be available:

IF :PARAMETER.Startup_Date + 1 < :System.Current_Datetime
THEN Message ('You have been logged on for more than a day.');
ELSE Message ('You just logged on today.');
END IF;