目录
1、使用cast强转
--timestamp 字段转日期
select cast(timestamp as date);
2、使用内置函数
--当前日期时间 当前时间转timestamp timestamp转日期时间
select getdate(),unix_timestamp(now()),from_unixtime(1691135518);
结果展现:
_c0 | _c1 | _c2 |
2023-08-04 15:51:58 | 1691135518 | 2023-08-04 15:51:58 |