date_part('timezone_hour')

Started by Jukka Väänänenover 22 years ago2 messagesgeneral
Jump to latest
#1Jukka Väänänen
jukka.vaananen@batman.jypoly.fi

hi,

using postgresql 7.3.1:

# select current_timestamp,date_part('timezone_hour',current_timestamp);
timestamptz | date_part
-------------------------------+-----------
2003-09-16 10:51:58.228489+03 | -3
(1 row)

I would expect date_part('timezone_hour') to return 3. But it returns -3
instead. Why so?

-Jukka

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Jukka Väänänen (#1)
Re: date_part('timezone_hour')

=?ISO-8859-1?Q?Jukka_V=E4=E4n=E4nen?= <jukka.vaananen@batman.jypoly.fi> writes:

using postgresql 7.3.1:

# select current_timestamp,date_part('timezone_hour',current_timestamp);
timestamptz | date_part
-------------------------------+-----------
2003-09-16 10:51:58.228489+03 | -3
(1 row)

I would expect date_part('timezone_hour') to return 3. But it returns -3
instead. Why so?

Because someone got it backwards ;-). We have reversed the sign of this
result for 7.4.

regards, tom lane