Mysql mysql 数据库获取当前时间

curitis · 2021-07-26 14:44:27 · 热度: 19

1、current_timestamp 函数

mysql> select current_timestamp;
+---------------------+
| current_timestamp   |
+---------------------+
| 2021-07-26 14:39:27 |
+---------------------+
1 row in set (0.00 sec)

2、current_time 函数

mysql> select current_time;
+--------------+
| current_time |
+--------------+
| 14:40:39     |
+--------------+
1 row in set (0.00 sec)

3、current_date 函数

mysql> select current_date;
+--------------+
| current_date |
+--------------+
| 2021-07-26   |
+--------------+
1 row in set (0.00 sec)

4、now() 函数

mysql> select now();
+---------------------+
| now()               |
+---------------------+
| 2021-07-26 14:42:48 |
+---------------------+
1 row in set (0.00 sec)

5、curdate() 函数

mysql> select curdate();
+------------+
| curdate()  |
+------------+
| 2021-07-26 |
+------------+
1 row in set (0.00 sec)

6、curtime() 函数

mysql> select curtime();
+-----------+
| curtime() |
+-----------+
| 14:43:40  |
+-----------+
1 row in set (0.00 sec)

猜你喜欢:
暂无回复。
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册