Re: to_char issue?

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: bruce(at)momjian(dot)us
Cc: Dave Page <dpage(at)pgadmin(dot)org>, Pg Bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: to_char issue?
Date: 2010-02-23 06:29:14
Message-ID: 201002230629.o1N6TEo23040@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

bruce wrote:
> Dave Page wrote:
> > This was posted as a documentation comment:
> >
> > to_char(interval '0d 0h 12m 44s', 'DD HH MI SS');
> > with HH and HH12 will return 12 instead of 0.
> >
> > Testing on 8.4.1, it does seem to be the case that you get "00 12 12
> > 44". Seems bogus to me, but am I and the OP missing something?
>
> Fixed with the attached patch. I think HH and HH24 should be the same
> for intervals. It is hard to explain why zero hours should show as
> '12' for intervals.

Oops, I needed a second patch to fix hours > 12 for intervals. Patch
attached and applied. It will now report the full hours of the
interval.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com
PG East: http://www.enterprisedb.com/community/nav-pg-east-2010.do
+ If your life is a hard drive, Christ can be your backup. +

Attachment Content-Type Size
/rtmp/diff text/x-diff 996 bytes

Browse pgsql-bugs by date

  From Date Subject
Next Message tomas 2010-02-23 07:05:37 Re: BUG #5341: problema al iniciar pgadmin
Previous Message Jaime Casanova 2010-02-23 04:15:08 Fwd: [BUGS] BUG #5341: problema al iniciar pgadmin