Re: Setting timezone: is it bug or intended? - Mailing list pgsql-bugs

From Bruce Momjian
Subject Re: Setting timezone: is it bug or intended?
Date
Msg-id 201104262130.p3QLUQI10021@momjian.us
Whole thread Raw
In response to Re: Setting timezone: is it bug or intended?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Setting timezone: is it bug or intended?
List pgsql-bugs
Tom Lane wrote:
> Bruce Momjian <bruce@momjian.us> writes:
> > As far as how to even document this, I have no idea.
>
> It already is documented.  See
> http://developer.postgresql.org/pgdocs/postgres/datatype-datetime.html#DATATYPE-TIMEZONES
> specifically the point that POSIX zone names have the opposite sign
> convention from ISO-8601.
>
> The great thing about standards is there are so many to choose from ;-)

What isn't documented is why the sign changes for +0300 but not +03:

    test=> set timezone='+03:00';
    SET
    test=> select now();
                  now
    -------------------------------
     2011-04-26 18:22:55.571638-03
    (1 row)

    test=> set timezone='+03';
    SET
    test=> select now();
                  now
    -------------------------------
     2011-04-27 00:23:00.627179+03
    (1 row)

It is the colon somehow:

    test=> set timezone='+03:';
    ERROR:  invalid value for parameter "TimeZone": "+03:"
    test=> select now();
                  now
    -------------------------------
     2011-04-26 18:24:36.921323-03
    (1 row)

    test=> set timezone='+03:0';
    SET
    test=> select now();
                 now
    ------------------------------
     2011-04-26 18:25:09.88588-03
    (1 row)

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Setting timezone: is it bug or intended?
Next
From: Tom Lane
Date:
Subject: Re: Setting timezone: is it bug or intended?