Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YdGGY-0004kV-4f for pgsql-bugs@arkaria.postgresql.org; Wed, 01 Apr 2015 10:52:58 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YdGGX-00066R-FE for pgsql-bugs@arkaria.postgresql.org; Wed, 01 Apr 2015 10:52:57 +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 1YdGGW-000663-Hd for pgsql-bugs@postgresql.org; Wed, 01 Apr 2015 10:52:56 +0000 Received: from mta02.ornl.gov ([128.219.177.12]) by magus.postgresql.org with esmtps (TLS1.0:DHE_RSA_CAMELLIA_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1YdGGQ-0004Wf-Th for pgsql-bugs@postgresql.org; Wed, 01 Apr 2015 10:52:53 +0000 X-SG: RELAYLIST X-IronPort-AV: E=Sophos;i="5.11,503,1422939600"; d="scan'208";a="77489639" Received: from emgwy2.ornl.gov ([160.91.254.10]) by iron2.ornl.gov with ESMTP/TLS/DHE-RSA-AES256-SHA; 01 Apr 2015 06:52:45 -0400 Received: from EXCHOS31.ornl.gov (exchos31.ornl.gov [128.219.12.151]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by emgwy2.ornl.gov (Postfix) with ESMTPS id CD03FE0FA1; Wed, 1 Apr 2015 06:52:45 -0400 (EDT) Received: from EXCHCS34.ornl.gov (128.219.12.148) by EXCHOS31.ornl.gov (128.219.12.151) with Microsoft SMTP Server (TLS) id 15.0.1044.25; Wed, 1 Apr 2015 06:52:45 -0400 Received: from EXCHCS32.ornl.gov (128.219.12.146) by EXCHCS34.ornl.gov (128.219.12.148) with Microsoft SMTP Server (TLS) id 15.0.1044.25; Wed, 1 Apr 2015 06:52:44 -0400 Received: from EXCHCS32.ornl.gov ([fe80::2408:8b8c:e63d:2a33]) by EXCHCS32.ornl.gov ([fe80::2408:8b8c:e63d:2a33%17]) with mapi id 15.00.1044.021; Wed, 1 Apr 2015 06:52:44 -0400 From: "Kistler, Winnie C." To: Tom Lane , "Kistler, Winnie C." CC: "pgsql-bugs@postgresql.org" Subject: Re: Problem with date formatting and FM Thread-Topic: [BUGS] Problem with date formatting and FM Thread-Index: AQHQavBv4jlKKZ4vekqsDSp696UXRp03kECAgABt0wA= Date: Wed, 1 Apr 2015 10:52:44 +0000 Message-ID: References: <27361.1427847577@sss.pgh.pa.us> In-Reply-To: <27361.1427847577@sss.pgh.pa.us> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.4.8.150116 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [128.219.12.132] Content-Type: text/plain; charset="us-ascii" Content-ID: <82C46BA94A66A94483A9D8ADC9D8FF46@ornl.gov> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Pg-Spam-Score: -6.9 (------) 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 Tom, Thanks for your reply. It is odd that it is behaving differently on our system. I tried your example instead of using the "entry_date" column just to be absolutely sure, and I get the same error. I also tried toggling the "FM" but it doesn't seem to work like it does on Oracle. Will check with EDB to see what they say. Thank you, Winnie Kistler On 3/31/15 8:19 PM, "Tom Lane" wrote: >"Kistler, Winnie C." writes: >> I am noticing that whenever I put "FM" in front of the date (DD), it >>seems to affect the hour and minutes of the time as well. >> So for example: >> to_char(entry_date, 'Mon FMDD YYYY HH12:MIAM') converts '2014-04-01 >>15:07:00' to 'Apr 1 2014 3:7PM' >> In this example, I would expect the result to look like: 'Apr 1 2014 >>03:07PM' > >I can't reproduce that. > >regression=3D# select to_char('2014-04-01 15:07:00'::timestamp, 'Mon DD >YYYY HH12:MIAM'); > to_char=20=20=20=20 >--------------------- > Apr 01 2014 03:07PM >(1 row) > >regression=3D# select to_char('2014-04-01 15:07:00'::timestamp, 'Mon FMDD >YYYY HH12:MIAM'); > to_char=20=20=20=20=20 >-------------------- > Apr 1 2014 03:07PM >(1 row) > >> We are using PostgreSQL version 9.4.1.4. >> EnterpriseDB 9.4.1.4 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) >>4.1.2 20080704 (Red Hat 4.1.2-55), 64-bit > >Hm. You should be asking EDB for support then, not the PG community. >But I wonder whether EDB has modified their version to be more >Oracle-like on this point. > > regards, tom lane --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs