MySQL日期函数sysdate()与now()的区别,获取当前时间,日期相关函数
select sleep(2) as datetime
union all
select sysdate() -- sysdate() 返回的时间是当前的系统时间,而 now() 返回的是当前的会话时间。
union all
select now() -- 等价于 localtime,localtime(),localtimestamp,localtimestamp(),current_timestamp,current_timestamp()
union all
select concat(curdate(),' ',curtime())
union all
select concat(date(now()),' ',time(now()))
union all
select concat(year(now()),'-',month(now()),'-',day(now()),' ',hour(now()),':',minute(now()),':',second(now()))
union all
select dayname(now())
union all
select monthname(now());