/* -----------------------------------------------------------------------
* formatting.c
*
- * $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.164 2010/02/23 01:42:19 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.165 2010/02/23 06:29:01 momjian Exp $
*
*
* Portions Copyright (c) 1999-2010, PostgreSQL Global Development Group
case DCH_HH:
case DCH_HH12:
sprintf(s, "%0*d", S_FM(n->suffix) ? 0 : 2,
- !is_interval && tm->tm_hour % (HOURS_PER_DAY / 2) == 0 ?
+ is_interval ? tm->tm_hour :
+ tm->tm_hour % (HOURS_PER_DAY / 2) == 0 ?
12 : tm->tm_hour % (HOURS_PER_DAY / 2));
if (S_THth(n->suffix))
str_numth(s, s, S_TH_TYPE(n->suffix));