SAS datetime to calendar date

For example, 2000000000 is Thu, May 18, 2023, 03:33:20 AM UTC, which is 2023-05-18T03:33:20.000Z in ISO 8601 and 1684380800 in Unix seconds.

SAS datetime: seconds since 1960-01-01T00:00:00. SAS stores no timezone, so the value is shown as UTC. Unix time = SAS − 315619200.

Detected: SAS datetime/t/2000000000

Your timezone

UTC · GMT+00:00 · UTC

Thu, May 18, 2023, 03:33:20 AM

Common formats

UTC

Thu, May 18, 2023, 03:33:20 AM

ISO 8601

2023-05-18T03:33:20.000Z

Unix (seconds)

1684380800

Unix (millis)

1684380800000

Relative

…

A SAS datetime value counts seconds since midnight on 1 January 1960, and a SAS date value counts days from the same day, so the two look nothing alike: 2000000000 is a datetime in 2023 while 23000 is a date in 2022. Paste either below. Values under 1,000,000 are read as days and larger ones as seconds, and the result says which. SAS stores no timezone with either, so the result is shown as UTC.

Do it with the API

curl https://parsetime.dev/api/t/2000000000?format=sas

The same conversion as JSON: no key, no signup, permissive CORS. Try this call or read the API docs.

Common questions

How do I convert a SAS datetime to a Unix timestamp?
Subtract 315619200, the number of seconds between 1 January 1960 and 1 January 1970. SAS datetime 2000000000 is Unix 1684380800. For a SAS date, Unix seconds = (days − 3653) × 86400.
How does this page tell a SAS date from a SAS datetime?
By size. A SAS date for any year after 1960 is a few thousand to a few tens of thousands of days, while a datetime is in the billions, so values under 1,000,000 are read as days. The only values that trip the rule are datetimes in the first twelve days of 1960.
Does a SAS datetime have a timezone?
No. SAS stores the number only, in whatever zone the system or the TIMEZONE option was using when it was written. This page shows the value as UTC; if the data came from a server in another zone, read the result as that zone's wall clock.
Can I convert a SAS datetime with the API?
Yes: GET /api/t/2000000000?format=sas returns the decoded date as JSON, and /api/t/23000?format=sas reads a SAS date.

Related pages