我的数据库中碰巧有包含timestamp without time zone列的表。现在,我需要将它们与时区进行比较。
我可以这样做:
select my_timestamp::timestamp with time zone at time zone 'EST5EDT'
from my_table
where
my_timestamp >= '2010-07-01'::timestamp at time zone 'EST5EDT'
and my_timestamp < '2010-08-01'::timestamp at time zone 'EST5EDT'这变得很丑陋。有没有一种更短的方法,不需要我键入timestamp with time zone作为类型,at time zone作为转换?
发布于 2010-07-13 00:27:53
timestamptz是timestamp with time zone的别名,timestamp是timestamp without time zone的别名。
我不认为at time zone有化名。
https://stackoverflow.com/questions/3230186
复制相似问题