SAS Timestamp Converter

Enter a SAS datetime value (seconds since January 1, 1960) or a SAS date value (days since January 1, 1960) into the SAS Timestamp Converter and get back the corresponding human-readable calendar date and time. Choose your conversion type — datetime or date — and the tool returns the converted date, day of week, and equivalent Unix timestamp so you can cross-reference with other systems.

SAS datetime values are seconds; SAS date values are days — both counted from January 1, 1960.

Enter a SAS datetime (large number, e.g. 2088768000) or SAS date (smaller number, e.g. 24175).

Results

Converted Date & Time

--

Day of Week

--

Equivalent Unix Timestamp

--

Offset from Unix Epoch (seconds)

--

ISO 8601 Format

--

Frequently Asked Questions

What is a SAS datetime value?

A SAS datetime value is the number of seconds elapsed since January 1, 1960 at midnight (00:00:00) GMT. For example, the value 2088768000 corresponds to a specific date and time in the 2020s. It differs from Unix time, which counts seconds from January 1, 1970.

What is the difference between a SAS date and a SAS datetime?

A SAS date value counts the number of days since January 1, 1960, and represents only a calendar date with no time component (e.g., 24175 ≈ July 4, 2026). A SAS datetime value counts the number of seconds since that same epoch and includes both date and time information.

How do I convert a SAS datetime to a Unix timestamp?

SAS and Unix timestamps share the same epoch difference of 315,619,200 seconds (the gap between January 1, 1960 and January 1, 1970). To convert a SAS datetime to a Unix timestamp, subtract 315,619,200 from the SAS value. This converter does that automatically for you.

What is the SAS epoch date?

The SAS epoch is January 1, 1960 at 00:00:00 GMT. All SAS date and datetime values are calculated relative to this anchor point. This is different from the Unix epoch (January 1, 1970) and the Excel epoch (January 1, 1900).

Can SAS timestamp values be negative?

Yes. A negative SAS datetime or date value represents a point in time before January 1, 1960. For example, a SAS date value of -1 corresponds to December 31, 1959. This converter supports negative values for historical date lookups.

What is the current SAS datetime value?

The current SAS datetime value is constantly incrementing and equals the current Unix timestamp plus 315,619,200. You can calculate it by taking the current UTC time in seconds since 1970 and adding that offset. At the time this tool was built, typical values are around 2 billion.

How do I get a SAS date or datetime value in SAS code?

In SAS, you can use the TODAY() function to return the current date as a SAS date value, and DATETIME() to return the current datetime as a SAS datetime value. To display them as readable dates, format them with DATE9. or DATETIME20. formats respectively.

Why does SAS use 1960 as its epoch instead of 1970?

SAS chose January 1, 1960 as its reference date when the software was first developed in the late 1960s and early 1970s. This predates the widespread adoption of Unix, which standardized on January 1, 1970. The choice of 1960 allowed SAS to handle historical statistical and demographic data that was common in its early use cases.

More Time & Date Tools