MySQL时间戳和时间格式转换函数

2022-11-09,,,

MySQL时间戳和时间格式转换函数:unix_timestamp and from_unixtime

unix_timestamp将时间转化成时间戳格式。
from_unixtime将时间戳转化成时间格式。

mysql> select unix_timestamp(now());
+-----------------------+
| unix_timestamp(now()) |
+-----------------------+
|            1251884321 |
+-----------------------+
1 row in set (0.00 sec)

mysql> select from_unixtime(1251884321);
+---------------------------+
| from_unixtime(1251884321) |
+---------------------------+
| 2009-09-02 17:38:41       |
+---------------------------+
1 row in set (0.00 sec)

来自为知笔记(Wiz)

MySQL时间戳和时间格式转换函数的相关教程结束。

《MySQL时间戳和时间格式转换函数.doc》

下载本文的Word格式文档,以方便收藏与打印。