views:

43

answers:

1

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?

+2  A: 

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.

Milen A. Radev