1960 was chosen on purpose
The SAS epoch 1960-01-01 is the first leap year of that decade and sits between COBOL’s 1960 defaults and IBM mainframe calendars—handy for 60s-era data.
Run a conversion below to see detailed outputs here.
Working with SAS data often means dealing with timestamps that do not look like normal dates. This SAS Time calculator makes those values easy to understand and convert. It translates SAS datetime and SAS date values into human-readable formats, and it converts standard dates back into SAS time so you can move between systems confidently.
In SAS, time is measured from a different starting point than Unix time. A SAS datetime value counts the number of seconds since 1960-01-01 00:00:00 UTC, while a SAS date value counts the number of whole days since 1960-01-01. Unix timestamps, by contrast, count seconds since 1970-01-01 00:00:00 UTC. That 10-year gap is why you often see a fixed offset between the two systems. This tool applies the correct offset and converts between seconds, days, and readable date-time strings so the meaning stays consistent.
This is useful in real-world workflows like data migration, analytics reporting, or troubleshooting time-based records in SAS datasets. For example, you might receive a SAS dataset with a datetime value and need to confirm the actual event time, or you might be building an ETL process that moves data between SAS and a database that stores Unix timestamps. The calculator helps validate those values quickly without manual math.
Keep in mind that SAS time is stored in UTC. Time zones and daylight saving time only affect how the value is displayed, not the stored number itself. If your results look off by an hour, check your display time zone or whether daylight saving adjustments are applied in your viewer.
Quick reference: UNIX and SAS datetime seconds differ by 315,619,200 seconds, and SAS date days differ by 3,653 days. This calculator handles those offsets for you so you can focus on the data, not the arithmetic.
Convert between SAS datetime seconds / date days and ISO-8601 dates.
const SAS_UNIX_OFFSET_SEC = 315_619_200; // 1960→1970
function unixToSasSeconds(unixSec){ return unixSec + SAS_UNIX_OFFSET_SEC; }
function sasSecondsToUnix(sasSec){ return sasSec - SAS_UNIX_OFFSET_SEC; }
function sasSecondsToDate(sasSec){ return new Date((sasSec - SAS_UNIX_OFFSET_SEC) * 1000); }
function dateToSasSeconds(d){ return d.getTime()/1000 + SAS_UNIX_OFFSET_SEC; }
function unixToSasDays(unixSec){ return Math.floor(unixSec/86400) + 3653; }
function sasDaysToUnix(sasDays){ return (sasDays - 3653) * 86400; }
import datetime
SAS_UNIX_OFFSET_SEC = 315_619_200
def sas_seconds_to_datetime(s): return datetime.datetime.fromtimestamp(s - SAS_UNIX_OFFSET_SEC, tz=datetime.timezone.utc)
def datetime_to_sas_seconds(dt):
if dt.tzinfo is None: dt = dt.astimezone()
return dt.timestamp() + SAS_UNIX_OFFSET_SEC
def sas_days_to_date(d): # returns date at 00:00 UTC
sec = (d - 3653) * 86400
return datetime.datetime.fromtimestamp(sec, tz=datetime.timezone.utc)
The SAS epoch 1960-01-01 is the first leap year of that decade and sits between COBOL’s 1960 defaults and IBM mainframe calendars—handy for 60s-era data.
The Unix ↔ SAS seconds gap is 315,619,200 seconds, a tidy 0x12D53D80. Add or subtract it to hop epochs instantly.
SAS date day 3,653 equals 1970-01-01. Negative days walk backward: -3,653 is 1949-12-31.
SAS datetime values can include decimals. The converter keeps sub-second precision intact when jumping between SAS seconds and ISO strings.
Excel’s default epoch is 1899; SAS is 1960. Converting between them requires two offsets: Excel ↔ Unix, then Unix ↔ SAS—so two hops, not one.