extract(timezone_hour) problem - Mailing list pgsql-hackers

From Key88 SF
Subject extract(timezone_hour) problem
Date
Msg-id F1630dU2Yrh8H2cRXzN00022dcc@hotmail.com
Whole thread Raw
List pgsql-hackers
I understand that internally, Postgres converts timestamps to a GMT format 
and then redisplays them in the local timezone. cf: 
http://groups.google.com/groups?selm=Pine.LNX.4.30.0110100104320.672-100000%40peter.localdomain&oe=UTF-8&output=gplain

However --> doesn't this make the extract(timezone_hour...) function 
basically useless? May as well call it "get_local_timezone_hour". How can 
one extract the timezone offset of a timestamp w/timezone (ie. get the 
intended behaviour of the extract call) ???

blackcherry=# SELECT extract(timezone_hour from TIMESTAMP WITH TIME ZONE 
'2001-02-16 20:38:40-05');
date_part
-----------        8
(1 row)

blackcherry=# SELECT extract(timezone_hour from TIMESTAMP WITH TIME ZONE 
'2001-02-16 20:38:40-00');
date_part
-----------        8
(1 row)



-Dave



_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?page=features/featuredemail



pgsql-hackers by date:

Previous
From: Jon Jensen
Date:
Subject: Re: Changing behavior of BEGIN...sleep...do something...COMMIT
Next
From: Peter Eisentraut
Date:
Subject: Re: PostgreSQL and SOAP, version 7.4/8.0