Thread: BUG #5552: incorrect returned value of time

BUG #5552: incorrect returned value of time

From
"Konstantin Kulikov"
Date:
The following bug has been logged online:

Bug reference:      5552
Logged by:          Konstantin Kulikov
Email address:      k.e.kulikov@gmail.com
PostgreSQL version: 8.3
Operating system:   unix
Description:        incorrect returned value of time
Details:

select current_timestamp at time zone 'GMT+3';

will return actually 'GMT-3'

Re: BUG #5552: incorrect returned value of time

From
"Milen A. Radev"
Date:
На 12.07.2010 г. 10:16, Konstantin Kulikov написа:
>
> The following bug has been logged online:
>
> Bug reference:      5552
> Logged by:          Konstantin Kulikov
> Email address:      k.e.kulikov@gmail.com
> PostgreSQL version: 8.3
> Operating system:   unix
> Description:        incorrect returned value of time
> Details:
>
> select current_timestamp at time zone 'GMT+3';
>
> will return actually 'GMT-3'

Excerpts from the docs ("8.5.3. Time Zones",
http://www.postgresql.org/docs/8.3/static/datatype-datetime.html#DATATYPE-TIMEZONES):

" - In addition to the timezone names and abbreviations, PostgreSQL will
accept POSIX-style time zone specifications of the form STDoffset or
STDoffsetDST, where STD is a zone abbreviation, offset is a numeric
offset in hours west from UTC, and DST is an optional daylight-savings
zone abbreviation, assumed to stand for one hour ahead of the given
offset..."

and:

"Another issue to keep in mind is that in POSIX time zone names,
positive offsets are used for locations west of Greenwich. Everywhere
else, PostgreSQL follows the ISO-8601 convention that positive timezone
offsets are east of Greenwich. ..."


--
Milen A. Radev

Re: BUG #5552: incorrect returned value of time

From
Tom Lane
Date:
"Konstantin Kulikov" <k.e.kulikov@gmail.com> writes:
> Description:        incorrect returned value of time

> select current_timestamp at time zone 'GMT+3';

> will return actually 'GMT-3'

This is unfortunate, but it's not a bug.  There are two different
standards about the sign of timezone offsets, and Postgres has to
deal with both of them.  See
http://www.postgresql.org/docs/current/static/datatype-datetime.html#DATATYPE-TIMEZONES
particularly the note that

    Another issue to keep in mind is that in POSIX time zone names,
    positive offsets are used for locations west of
    Greenwich. Everywhere else, PostgreSQL follows the ISO-8601
    convention that positive timezone offsets are east of Greenwich.

            regards, tom lane