当前位置:Gxlcms > 数据库问题 > MYSQL int型日期处理

MYSQL int型日期处理

时间:2021-07-01 10:21:17 帮助过:12人阅读

使用unix_timestamp()将日期格式转换成int型

例如:
select now(),unix_timestamp(now()) ;
now() | unix_timestamp(now())
2014-11-28 09:54:43 | 1417139683

使用from_unixtime()从int型timestamp转换出日期
例如:
select upt_time,from_unixtime(upt_time) from drive_rel;
upt_time | from_unixtime(upt_time)
1336964014 | 2012-05-14 10:53:34
1361786530 | 2013-02-25 18:02:10
1284031294 | 2010-09-09 19:21:34

MYSQL int型日期处理

标签:drive   strong   amp   日期格式   使用   sel   mysq   now()   日期   

人气教程排行