mysql怎麼獲取系統時間

mysql中有幾個函數都可以獲取系統時間,用的比較多如下面幾個:

這3個函數的作用相同,都是返回當前時間,格式:yyyy-mm-dd hh:mm:ss

select now();
select current_timestamp();
select current_timestamp;

獲取Unix時間戳

select unix_timestamp(now());

更多關於mysql中時間的一些操作,可參考:https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章