MYSQL中UNIX时间戳与日期的转换
时间:2021-07-01 10:21:17
帮助过:5人阅读
select FROM_UNIXTIME(
1156219870,
‘%y-%m-%d‘);
+--------------------------------------+
| FROM_UNIXTIME(
1156219870,
‘%y-%m-%d‘)
|
+--------------------------------------+
| 06-08-22 |
+--------------------------------------+
1 row
in set (
0.03 sec)
mysql> SELECT UNIX_TIMESTAMP(
‘2006-11-04 12:23:00‘);
+---------------------------------------+
| UNIX_TIMESTAMP(
‘2006-11-04 12:23:00‘)
|
+---------------------------------------+
| 1162614180 |
+---------------------------------------+
1 row
in set (
0.00 sec)
MYSQL中UNIX时间戳与日期的转换
标签: