1. now
now() 返回当前时间戳2018-11-11 11:11:11
select now();
2. UNIX_TIMESTAMP
返回时间值select UNIX_TIMESTAMP('2017-06-10 13:02:18');
--14970709383. FROM_UNIXTIME
返回时间戳select FROM_UNIXTIME(1497070938, '%Y-%m-%d %H:%i:%S'); --2017-06-10 13:02:18 select FROM_UNIXTIME(1497070938); --2017-06-10 13:02:18
4. curtime
返回当前时间time(now()),current_time();
select curtime(),current_time(),time(now());
5. curdate
返回当前日期date(now()),current_date();
select curdate(),current_date(),date(now());
6.datediff
日期差select datediff('2008-08-08', '2008-08-01');
-- 7