字符串时间转10位时间戳
select FLOOR(unix_timestamp(create_time)) from page; #
create_time为字段名 page为表名
eg:select FLOOR(UNIX_TIMESTAMP(‘2020-06-30‘)) from `boc_circle` #结果为1593446400 /*2020-08-31 1598803200 2020-07-01 1593532800 2020-09-01 1598889600 2020-06-30 1593446400*/
13位时间戳转日期类型
select FROM_UNIXTIME(round(time_ms / 1000,0)) from page ; #
time_ms为字段名 page为表名
10位时间戳转日期类型
select FROM_UNIXTIME(time_ms) from page ; #
time_ms为字段名 page为表名
eg:select FROM_UNIXTIME(timeline) from `boc_circle_post` /*时分秒*/
select FROM_UNIXTIME(timeline,‘%Y-%m-%d‘)from `boc_circle_post`
mysql—MySQL数据库中10位或13位时间戳和标准时间相互转换
原文:https://www.cnblogs.com/Formulate0303/p/13678291.html