发布于 2022-11-28 17:30:46 浏览 362 次
语法:
SELECT FROM_UNIXTIME(time,'%Y-%m-%d %H-%i-%s');
案例1:
select FROM_UNIXTIME('1669627630') as dt;
结果:
2022-11-28 17:27:10.000000
案例2:
select FROM_UNIXTIME('1669627630','%Y-%m-%d %H-%i-%s') as dt;
结果:
2022-11-28 17:27:10
案例3:
select FROM_UNIXTIME('1669627630','%Y-%m-%d') as dt;
结果:
2022-11-28