DATE returns the current date at the time when the request started. If DATE is invoked more than once during the request, the same date is returned. The date returned does not change during the duration of the request.
If you specify DATE without the AT clause or DATE AT LOCAL, then the value returned depends on the setting of the DBS Control flag TimeDateWZControl as follows:
- If the TimeDateWZControl flag is enabled, DATE returns a date constructed from the session time and session time zone.
- If the TimeDateWZControl flag is disabled, DATE returns a date constructed from the time value local to Vantage and the session time zone.
DATE returns a value that is adjusted to account for the start and end of daylight saving time (DST) only in the following cases:
- DATE is specified with AT [TIME ZONE] time_zone_string, where time_zone_string follows different DST and standard time zone displacements.
- DATE is specified with AT LOCAL or without an AT clause and the session time zone was defined with a time zone string that follows different DST and standard time zone displacements.
DATE cannot appear as the first argument in a user-defined method invocation.