pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <bruce@momjian.us>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Yura Sokolov <funny.falcon@gmail.com>
Cc: Susanne Ebrecht <susanne@2ndQuadrant.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: Setting timezone: is it bug or intended?
Date: Tue, 26 Apr 2011 17:30:26 -0400 (EDT)
Message-ID: <201104262130.p3QLUQI10021@momjian.us> (raw)
In-Reply-To: <21802.1303850954@sss.pgh.pa.us>

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. +



view thread (8+ messages)  latest in thread

Message-ID: <201104262130.p3QLUQI10021@momjian.us>
Permalink:  ../201104262130.p3QLUQI10021@momjian.us/
Also on:    postgresql.org/message-id/201104262130.p3QLUQI10021@momjian.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: bruce@momjian.us, tgl@sss.pgh.pa.us, funny.falcon@gmail.com, susanne@2ndQuadrant.com
  Subject: Re: Setting timezone: is it bug or intended?
  In-Reply-To: <201104262130.p3QLUQI10021@momjian.us>
  References: <21802.1303850954@sss.pgh.pa.us> <201104262130.p3QLUQI10021@momjian.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox