pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Brian Powell <brian@filogroup.com>
To: pgsql-sql@postgresql.org
Subject: Bug in to_char()
Date: Wed, 12 Jul 2000 10:24:36 -0600
Message-ID: <B591F7E3.3AB2%brian@filogroup.com> (raw)

Greetings,

Working with PostGreSQL 7.02, I found the following problem:

The AM/PM designator in the to_char function does not work proper for 13:00
and 12:00.

See the following:

test=> select to_char('3-12-2000 14:00'::timestamp, 'Dy, HH12:MI PM');
    to_char    
---------------
 Sun, 02:00 PM
(1 row)


This is correct.


test=> select to_char('3-12-2000 8:00'::timestamp, 'Dy, HH12:MI PM');
    to_char    
---------------
 Sun, 08:00 AM
(1 row)

This is correct.

test=> select to_char('3-12-2000 13:00'::timestamp, 'Dy, HH12:MI PM');
    to_char    
---------------
 Sun, 01:00 AM
(1 row)

NO!  This is incorrect

test=> select to_char('3-12-2000 1:00'::timestamp, 'Dy, HH12:MI PM');
    to_char    
---------------
 Sun, 01:00 AM
(1 row)

This is correctly 1 am.

nicklebys=> select to_char('3-12-2000 12:00'::timestamp, 'Dy, HH12:MI PM');
    to_char    
---------------
 Sun, 12:00 AM
(1 row)

NO!  This is 12:00 pm.  0:00 or 24:00 is 12:00 am.

Any known work arounds or bug fixes planned?

Thanks,
Brian

-- 
   +-----------------------------------------------------------+
   |  Brian Powell, President             brian@filogroup.com  |
   |  Filo Group                          www.filogroup.com    |
   |  One Broadway, Suite 300A            AIM: filogroupbrian  |
   |  Denver, CO  80203                   ICQ: 75037370        |
   |  303.733.3248 office                 303.733.7122 fax     |
   +-----------------------------------------------------------+





view thread (2+ messages)  latest in thread

Message-ID: <B591F7E3.3AB2%brian@filogroup.com>
Permalink:  ../B591F7E3.3AB2%25brian@filogroup.com/
Also on:    postgresql.org/message-id/B591F7E3.3AB2%brian@filogroup.com

 · 

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-sql@postgresql.org
  Cc: brian@filogroup.com
  Subject: Re: Bug in to_char()
  In-Reply-To: <B591F7E3.3AB2%brian@filogroup.com>
  References: <B591F7E3.3AB2%brian@filogroup.com>

* 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