1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Allow to_char(interval) and to_char(time) to use AM/PM specifications.

Map them to a single day, so '30 hours' is 'AM'.

Have to_char(interval) and to_char(time) use "HH", "HH12" as 12-hour
intervals, rather than bypass and print the full interval hours.  This
is neeeded because to_char(time) is mapped to interval in this function.
Intervals should use "HH24", and document suggestion.

Allow "D" format specifiers for interval/time.
This commit is contained in:
Bruce Momjian
2005-12-03 16:45:06 +00:00
parent eb339c7840
commit d20901a39b
2 changed files with 25 additions and 21 deletions

View File

@ -1,5 +1,5 @@
<!--
$PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.296 2005/11/28 23:18:48 momjian Exp $
$PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.297 2005/12/03 16:45:05 momjian Exp $
PostgreSQL documentation
-->
@ -4749,6 +4749,14 @@ SELECT SUBSTRING('XY1234Z', 'Y*?([0-9]{1,3})');
<function>extract</function> function.
</para>
</listitem>
<listitem>
<para><function>to_char(interval)</function> formats <literal>HH</> and
<literal>HH12</> as hours in a single day, while <literal>HH24</>
can output hours exceeding a single day, e.g. &gt;24.
</para>
</listitem>
</itemizedlist>
</para>