now()
获取时间 date + timesysdate()
获取时间 date + timesysdate 与 now 类似,但 now 在执行开始时就得到了值,sysdate 会动态获取,如下说明
mysql> select now(), sleep(3), now();
+---------------------+----------+---------------------+
| now() | sleep(3) | now() |
+---------------------+----------+---------------------+
| 2008-08-08 22:28:21 | 0 | 2008-08-08 22:28:21 |
+---------------------+----------+---------------------+
current_timestamp()
获取当前时间戳date_format(date,format)
time_format(time,format)
将日期转换为各种时间格式
str_to_date(str,format)
这是一个逆函数,将时间格式转换为时间
to_days(date), from_days(days)
这是一对逆函数,计算从 0000-00-00 的天数
time_to_sec(time), sec_to_time(seconds)
将时刻转换为秒与将秒转换为时刻