Skip to main content
Previous section   Next section

DATE

Returns the current local system date in internal format.

Synopsis

DATE()

Arguments

None. The parentheses are mandatory.

Description

The DATE function returns the current date in a format such as the following:

14122

This represents the elapsed number of days since December 31, 1967. DATE returns the current date at the moment when the function is executed.

Caché MultiValue determines local time (and date) as follows:

  • It determines the current Coordinated Universal Time (UTC) from the system clock.

  • It adjusts UTC to the local time zone by using the value of the Caché special variable $ZTIMEZONE.

  • It applies local time variant settings (such as Daylight Saving Time) for that time zone from the host operating system.

Caché MVBasic also supplies @DATE, @DAY, @MONTH, @YEAR, and @YEAR4 system variables. These values are set when the process is initialized, and are only updated when a program is initiated from the MV shell. For further details, see the Variables page of this manual.

Examples

The following example calls the DATE function to return the current date in internal format, then uses the OCONV function to convert date from internal format to display format.

PRINT DATE()
PRINT OCONV(DATE(),"D")
Copy code to clipboard

See Also