例子,mysql now函数的用法。
在mysql数据库中有三个函数,可以获取当前时间与当前日期,它们分别是now()、CURDATE() 、CURTIME()。
There are three functions that you can use to get the current date and time.
NOW() gets both date and time.
CURDATE() works with only the date.
CURTIME() is for the time.
sql语句如下:
复制代码 代码示例:
mysql> SELECT NOW();
+---------------------+
| NOW() |
+---------------------+
| 2007-07-21 13:54:27 |
+---------------------+
1 row in set (0.00 sec)