1.獲取當前日期+時間
now(); — —> select now(); //或者 :select now() as Systemtime;
sysdate(); — —> select sysdate(); //或者 :select sysdate() as Systemtime;
這兩個函數都是獲取當前日期+時間,不同之處在於:now()在執行開始時值就得到了,sysdate()在函數執行時動態得到值;NOW()函數以`'YYYY-MM-DD HH:MM:SS'返回當前的日期時間,可以直接存到DATETIME字段中。Sysdate()函數也是如此。
2.獲取當前日期:
curdate();
current_date();
current_date;
3.獲取當前時間:
curtime();
current_time();
current_time;
4.獲取UTC時間
A.獲取UTC日期:utc_date();
B.獲取UTC時間:utc_time();
C.獲取UTC日期+時間:utc_timestamp;
轉發於https://blog.csdn.net/Charlene_y/article/details/80332629
