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/83834071mysql