Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YLDY2-0001Dm-OS for pgsql-bugs@arkaria.postgresql.org; Tue, 10 Feb 2015 16:20:26 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YLDY2-0003lz-7Q for pgsql-bugs@arkaria.postgresql.org; Tue, 10 Feb 2015 16:20:26 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YL7Z4-0004UK-Qb for pgsql-bugs@postgresql.org; Tue, 10 Feb 2015 09:57:06 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YL7Z1-0001QB-Sf for pgsql-bugs@postgresql.org; Tue, 10 Feb 2015 09:57:05 +0000 MIME-Version: 1.0 Subject: BUG #12754: The 'OF' template pattern of to_char() print incorrect results with negative offsets with minutes To: pgsql-bugs@postgresql.org From: david.pozsar@gmail.com Date: Tue, 10 Feb 2015 09:56:58 +0000 Message-ID: <20150210095658.18792.72359@wrigleys.postgresql.org> X-Pg-Spam-Score: -0.3 (/) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org The following bug has been logged on the website: Bug reference: 12754 Logged by: David Pozsar Email address: david.pozsar@gmail.com PostgreSQL version: 9.4.0 Operating system: Windows 7 Description: If the current time-zone has minutes and is negative, to_char('OF') prints a negative sign before the minute part too. Code, to reproduce: set time zone interval '-02:30'; -- or: set timezone to -2.5; select ts::text, to_char(ts, 'YYYY-MM-DD HH24:MI:SSOF') from (values (timestamptz '2015-02-10 07:05:15+00')) v(ts); Output: ts | to_char ---------------------------+---------------------------- 2015-02-10 04:35:15-02:30 | 2015-02-10 04:35:15-02:-30 Expected output: ts | to_char ---------------------------+--------------------------- 2015-02-10 04:35:15-02:30 | 2015-02-10 04:35:15-02:30 -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs