SASHelp
SASHelp
SASHelp
Function Arguments
Function Results
Function Categories
Host Functions
Arithmetic Functions
Quantile Functions
Bitwise Logical Functions
Probability and Density Functions
Character Functions
Character String Matching Functions
Random Number Functions
SAS File I/O Functions
Sample Statistic Functions
Date and Time Functions
Dynamic Link Library
Special Functions
External File Functions
State and Zip Code Functions
Financial Functions
Trigonometric Functions
Library and Catalog Functions
Truncation Functions
Mathematical Functions
DBCS Functions
Variable Information Functions
Noncentrality Functions Web Tools
SAS FUNCTIONS: Date and Time
Functions
DATDIF(sdate,edate,basis) returns the number of days
between two dates
DATE() returns the current date as a
SAS date value
DATEJUL(julian-date) converts a Julian date to a SAS
date value
DATEPART(datetime) extracts the date from a SAS
datetime value
DATETIME() returns the current date and
time of day
DAY(date) returns the day of the month
from a SAS date value
DHMS(date,hour,minute,second) returns a SAS datetime value
from date, hour, minute, and
second
HMS(hour,minute,second) returns a SAS time value from
hour, minute, and second
HOUR(<time | datetime>) returns the hour from a SAS
time or datetime value
INTCK('interval',from,to) returns the number of time
intervals in a given time span
INTNX('interval',start- advances a date, time, or
from,increment<,'alignment'>) datetime value by a given
interval, and returns a date,
time, or datetime value
JULDATE(date) returns the Julian date from a
SAS date value
MDY(month,day,year) returns a SAS date value from
month, day, and year values
MINUTE(time | datetime) returns the minute from a SAS
time or datetime value
MONTH(date) returns the month from a SAS
date value
QTR(date) returns the quarter of the year
from a SAS date value
SECOND(time | datetime) returns the second from a SAS
time or datetime value
TIME() returns the current time of day
TIMEPART(datetime) extracts a time value from a
SAS datetime value
TODAY() returns the current date as a
SAS date value
WEEKDAY(date) returns the day of the week
from a SAS date value
YEAR(date) returns the year from a SAS
date value
YRDIF(sdate,edate,basis) returns the difference in years
between two dates
YYQ(year,quarter) returns a SAS date value from
the year and quarter