控制PSQL的时间戳timestamp精度

控制PSQL的时间戳timestamp精度

问题:

select now()

结果:

需求:只保留到秒的级别:

select now()::timestamp (0) // 返回时间类型

或

select ('now'::text)::timestamp(0) without time zone //返回文本类型

结果:

猜你喜欢

转载自blog.csdn.net/qq_41995919/article/details/115013213