DATE Function

Returns the current date as a SAS date value.

Categories:Date and Time
CAS
Alias:TODAY
Interaction:If the value of the TIMEZONE= system option is set to a time zone name or time zone ID, the date and time values that are returned for this function are determined by the time zone.
See:TODAY Function

Syntax

DATE()

Details

The DATE function produces the current date in the form of a SAS date value, which is the number of days since January 1, 1960.

Examples

Example 1: Determining a Date Value for an America/Los_Angeles Time Zone

This example shows how the DATE function returns a date value based on the value of the TIMEZONE= system option.
option timezone='America/Los_Angeles';
data _null_;
   d1=date();
   put d1=nldate.;
run;
SAS writes the following results to the log:
d1=November 07, 2012

Example 2: Determining a Date Value for an Asia/Shanghai Time Zone

This example shows how the DATE function returns a date value based on the value of the TIMEZONE= system option.
option timezone='Asia/Shanghai';
data _null_;
   d2=date();
   put d2=nldate.;
run;
SAS writes the following results to the log:
d2=November 08, 2012
Last updated: March 16, 2017