SELECT CAST(CURRENT_TIMESTAMP AS DATE) AS TODAY;
執行結果
SELECT CAST(CURRENT_TIMESTAMP AS TIME) AS TIME;
執行結果
SELECT CURRENT_TIMESTAMP ;
執行結果
SELECT CURRENT_TIMESTAMP ,
DATEPART(YEAR, CURRENT_TIMESTAMP) AS '年',
DATEPART(MONTH, CURRENT_TIMESTAMP) AS '月',
DATEPART(DAY, CURRENT_TIMESTAMP) AS '日',
DATEPART(HOUR, CURRENT_TIMESTAMP) AS '時',
DATEPART(MINUTE, CURRENT_TIMESTAMP) AS '分',
DATEPART(SECOND, CURRENT_TIMESTAMP) AS '秒';