mirror of
https://github.com/postgres/postgres.git
synced 2025-08-08 06:02:22 +03:00
Fix to_char(), to_date(), and to_timestamp() to handle negative/BC
century specifications just like positive/AD centuries. Previously the behavior was either wrong or inconsistent with positive/AD handling. Centuries without years now always assume the first year of the century, which is now documented.
This commit is contained in:
@@ -5575,7 +5575,9 @@ SELECT SUBSTRING('XY1234Z', 'Y*?([0-9]{1,3})');
|
||||
if there is a <literal>YYY</literal>, <literal>YYYY</literal> or
|
||||
<literal>Y,YYY</literal> field. If <literal>CC</literal> is used with
|
||||
<literal>YY</literal> or <literal>Y</literal> then the year is computed
|
||||
as <literal>(CC-1)*100+YY</literal>.
|
||||
as the year in the specified century. If the century is
|
||||
specified but the year is not, the first year of the century
|
||||
is assumed.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
|
Reference in New Issue
Block a user