extract(timezone_hour) problem

From: "Key88 SF" <key88sf(at)hotmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: peter_e(at)gmx(dot)net
Subject: extract(timezone_hour) problem
Date: 2003-03-29 06:30:05
Message-ID: F1630dU2Yrh8H2cRXzN00022dcc@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2003-03-29 11:26:00 Re: PostgreSQL and SOAP, version 7.4/8.0
Previous Message Jon Jensen 2003-03-29 04:54:05 Re: Changing behavior of BEGIN...sleep...do something...COMMIT