473,750 Members | 2,478 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

date_part('time zone_hour')


hi,

using postgresql 7.3.1:

# select current_timesta mp,date_part('t imezone_hour',c urrent_timestam p);
timestamptz | date_part
-------------------------------+-----------
2003-09-16 10:51:58.228489 +03 | -3
(1 row)

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

-Jukka

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddres sHere" to ma*******@postg resql.org)

Nov 11 '05 #1
1 3212
=?ISO-8859-1?Q?Jukka_V=E4= E4n=E4nen?= <ju************ @batman.jypoly. fi> writes:
using postgresql 7.3.1: # select current_timesta mp,date_part('t imezone_hour',c urrent_timestam p);
timestamptz | date_part
-------------------------------+-----------
2003-09-16 10:51:58.228489 +03 | -3
(1 row) I would expect date_part('time zone_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

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 11 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.