Skip to content

Commit e177da5

Browse files
committed
Doc: fix bogus to_date() examples.
November doesn't have 31 days. Remarkably, this thinko has escaped detection since commit 3f19987. Noted by Y. Saburov. Discussion: https://postgr.es/m/171276122213.681.531905738590773705@wrigleys.postgresql.org
1 parent 3ceb2f9 commit e177da5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

doc/src/sgml/func.sgml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8285,11 +8285,11 @@ SELECT regexp_match('abc01234xyz', '(?:(.*?)(\d+)(.*)){1,1}');
82858285
use some non-digit character or template after <literal>YYYY</literal>,
82868286
otherwise the year is always interpreted as 4 digits. For example
82878287
(with the year 20000):
8288-
<literal>to_date('200001131', 'YYYYMMDD')</literal> will be
8288+
<literal>to_date('200001130', 'YYYYMMDD')</literal> will be
82898289
interpreted as a 4-digit year; instead use a non-digit
82908290
separator after the year, like
8291-
<literal>to_date('20000-1131', 'YYYY-MMDD')</literal> or
8292-
<literal>to_date('20000Nov31', 'YYYYMonDD')</literal>.
8291+
<literal>to_date('20000-1130', 'YYYY-MMDD')</literal> or
8292+
<literal>to_date('20000Nov30', 'YYYYMonDD')</literal>.
82938293
</para>
82948294
</listitem>
82958295

0 commit comments

Comments
 (0)