Re: Setting timezone: is it bug or intended?

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Yura Sokolov <funny(dot)falcon(at)gmail(dot)com>, Susanne Ebrecht <susanne(at)2ndQuadrant(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Setting timezone: is it bug or intended?
Date: 2011-04-26 21:30:26
Message-ID: 201104262130.p3QLUQI10021@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Tom Lane wrote:
> Bruce Momjian <bruce(at)momjian(dot)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(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2011-04-26 21:48:50 Re: Setting timezone: is it bug or intended?
Previous Message Tom Lane 2011-04-26 20:49:14 Re: Setting timezone: is it bug or intended?