From: Tom Lane Date: Thu, 11 Apr 2024 15:09:00 +0000 (-0400) Subject: Doc: fix bogus to_date() examples. X-Git-Tag: REL_14_12~24 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=da11a14e0c79af98869ce8929fa9bdfe7cc690cb;p=postgresql.git Doc: fix bogus to_date() examples. November doesn't have 31 days. Remarkably, this thinko has escaped detection since commit 3f1998727. Noted by Y. Saburov. Discussion: https://postgr.es/m/171276122213.681.531905738590773705@wrigleys.postgresql.org --- diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 58691ee5781..fd877a4ea81 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -7814,11 +7814,11 @@ SELECT regexp_match('abc01234xyz', '(?:(.*?)(\d+)(.*)){1,1}'); use some non-digit character or template after YYYY, otherwise the year is always interpreted as 4 digits. For example (with the year 20000): - to_date('200001131', 'YYYYMMDD') will be + to_date('200001130', 'YYYYMMDD') will be interpreted as a 4-digit year; instead use a non-digit separator after the year, like - to_date('20000-1131', 'YYYY-MMDD') or - to_date('20000Nov31', 'YYYYMonDD'). + to_date('20000-1130', 'YYYY-MMDD') or + to_date('20000Nov30', 'YYYYMonDD').