Date and time formats in sas

SAS interpretes the date as the number of days since december1 1960(as IBM launched date.)

some hints

today() -> returns the number of days from 1960 dec 1

times -> number of seconds from midday

datetime -> number of seconds from midday 1960 dec 1;

fixed date = ‘10mar2018’d <here d is called as d literal>
‘3.56't time literal

datdif() >returns difference in days

yrdiff() >returns difference in days

intck() -> number of time intervals boundaries

intck(‘year’, mdy(12,31,year), ‘14MAR2019’d,’continuous’)

intnx() -> calculates last date

intnx('month', '14MAR2019'd, 3, 'sameday');

date after 3 months.

format dow. >> represents weekday into text such as 1 as sunday

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store