SAS 時(shí)間轉(zhuǎn)換函數(shù)(SAS Date, Time, and Datetime Functions)

SAS Date, Time, and Datetime Functions

DATE()

returns today's date as a SAS date value.

DATEJUL( yyddd )

returns the Julian date for a SAS date value.

DATEPART( datetime )

returns the date part of a SAS datetime value as a date 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 for date, hour, minute, and second values.

HMS( hour, minute, second )

returns a SAS time value for hour, minute, and second values.

HOUR( datetime )

returns the hour from a SAS datetime or time value.

INTCK( interval, date1, date2 )

returns the number of boundaries of intervals of the given kind that lie between the two date or datetime values.

INTNX( interval, date, n <, 'alignment' > )

returns the date or datetime value of the beginning of the interval that is n intervals from the interval that contains the given date or datetime value. The optional alignment argument specifies that the returned date is aligned to either the beginning, middle, or end of the interval. Beginning is the default.

JULDATE( date )

returns the Julian date from a SAS date value.

MDY( month, day, year )

returns a SAS date value for month, day, and year values.

MINUTE( datetime )

returns the minute from a SAS time or datetime value.

MONTH( date )

returns the month of the year from a SAS date value.

QTR( date )

returns the quarter of the year from a SAS date value.

SECOND( date )

returns the second from a SAS time or datetime value.

TIME()

returns the current time of day.

TIMEPART( datetime )

returns the time part of a SAS datetime value.

TODAY()

returns the current date as a SAS date value. (TODAY is another name for the DATE function.)

WEEKDAY( date )

returns the day of the week from a SAS date value.

YEAR( date )

returns the year from a SAS date value.

YYQ( year, quarter )

returns a SAS date value for year and quarter values.

(from:http://www.sfu.ca/sasdoc/sashtml/ets/chap3/sect13.htm

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容