Return to Archive

SAS Tip of the Month
January 2005

On New Years Eve I was reminded of the Y2K issue that arose to prominence in 1999. There were some who thought society would collapse as computers that processed year values of dates would stop working. In the end though there were isolated problems but on the whole the cross over to January 1, 2001 went without incident.

This leads me on to how SAS stores the date and time values within a dataset. This is different to the format for a variable that sets the display format for the date/time.

SAS dates are stored as the number of days from January 1, 1960 and account for all leap year days, including the leap year day in the year 2000.

SAS times count the number of seconds since midnight.

SAS datetimes are calculated as the number of seconds from midnight on January 1, 1960.

Updated January 6, 2005