Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id AE4AC1337B2F for ; Tue, 26 Apr 2011 18:30:38 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 83820-02 for ; Tue, 26 Apr 2011 21:30:31 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from momjian.us (momjian.us [70.90.9.53]) by mail.postgresql.org (Postfix) with ESMTP id 160E71337999 for ; Tue, 26 Apr 2011 18:30:30 -0300 (ADT) Received: (from bruce@localhost) by momjian.us (8.11.6/8.11.6) id p3QLUQI10021; Tue, 26 Apr 2011 17:30:26 -0400 (EDT) From: Bruce Momjian Message-Id: <201104262130.p3QLUQI10021@momjian.us> Subject: Re: Setting timezone: is it bug or intended? In-Reply-To: <21802.1303850954@sss.pgh.pa.us> To: Tom Lane Date: Tue, 26 Apr 2011 17:30:26 -0400 (EDT) CC: Yura Sokolov , Susanne Ebrecht , pgsql-bugs@postgresql.org X-Mailer: ELM [version 2.4ME+ PL124 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="US-ASCII" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201104/202 X-Sequence-Number: 30121 Tom Lane wrote: > Bruce Momjian 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 http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. +