獲取當前時間戳
select unix_timestamp();
同
select unix_timestamp(now());
獲當前時間
select now();
時間轉時間戳
select unix_timestamp('2018-01-15 09:45:16');
select from_unixtime(1515980716);
時間戳格式化
SELECT from_unixtime(1515980716, '%Y-%m-%d %H:%i:%S');
時間格式化
select date_format(now(), '%Y-%m-%d');
select date_format('2018-01-15 09:45:16', '%Y-%m-%d');