方法一 select current_date
mysql> select current_date as Systemtime;
+------------+
| Systemtime |
+------------+
| 2009-07-29 |
+------------+
方法二 select now()
mysql> select now() as Systemtime;
+---------------------+
| Systemtime |
+---------------------+
| 2009-07-29 19:06:07 |
+---------------------+
方法三 select sysdate()
mysql> select sysdate() as Systemtime;
+---------------------+
| Systemtime |
+---------------------+
| 2009-07-29 19:06:45 |
+---------------------+
原帖地址:http://blog.youkuaiyun.com/aini3456/article/details/6471081
本文介绍了三种在MySQL中获取当前日期和时间的方法:使用current_date(), now() 和 sysdate() 函数。这些方法可以帮助开发者轻松地在数据库操作中插入或查询当前的日期时间。

被折叠的 条评论
为什么被折叠?



