MySQL 获取当前时间戳
1. 秒级别时间戳
自19700101 00:00:00以来按秒算,SQL如下:
mysql> select unix_timestamp(now());
+-----------------------+
| unix_timestamp(now()) |
+-----------------------+
| 1541604376 |
+-----------------------+
1 row in set (0.00 sec)
1
2
3
4
5
6
7
2. 当前时间戳
mysql> select current_timestamp();
+---------------------+
| current_timestamp() |
+---------------------+
| 2019-01-04 20:37:19 |
+---------------------+
1 row in set (0.00 sec)
————————————————
版权声明:本文为CSDN博主「LittleLawson」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/liu16659/article/details/83834071