I happen to have tables with timestamp without time zone column in my database. Now I need to compare them with respect to time zone.
I can do it like:
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'
This is getting pretty ugly. Is there a shorter way that does not require me to type timestamp with time zone as type and at time zone as conversion?
timestamptz is an alias for timestamp with time zone, timestamp is an alias for timestamp without time zone.
I don't think at time zone has an alias.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With