Re: to_char issue? - Mailing list pgsql-bugs

From Bruce Momjian
Subject Re: to_char issue?
Date
Msg-id 201002230159.o1N1x4m10131@momjian.us
Whole thread Raw
In response to Re: to_char issue?  (Bruce Momjian <bruce@momjian.us>)
List pgsql-bugs
Bruce Momjian 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.

Oh, I should also mention that with the old code, 24 and 36 interval
hours would also return '12'.  :-(

--
  Bruce Momjian  <bruce@momjian.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. +

pgsql-bugs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: to_char issue?
Next
From: "Jaime Mendieta"
Date:
Subject: BUG #5341: problema al iniciar pgadmin