天天看点

mysql中sysdate(),curdate(),curtime(),now()

mysql中sysdate(),curdate(),curtime(),now()

  • sysdate() 返回实时的系统日期和时间
  • curdate() 返回语句执行时的日期
  • curtime() 返回语句执行时的时间
  • now() 返回语句执行时的日期和时间

一般在sql中使用now()

在Navicat中进行测试:

select

now(),sysdate(),curdate(),curtime(),sleep(5),now(),sysdate(),curdate(),curtime() from dual;

结果如下:

mysql中sysdate(),curdate(),curtime(),now()

继续阅读