Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite39feb1

Browse files
committed
Improve documentation of EXTRACT(WEEK).
The docs showed that early-January dates can be considered part of theprevious year for week-counting purposes, but failed to say explicitlythat late-December dates can also be considered part of the next year.Fix that, and add a cross-reference to the "isoyear" field. Per bug#7967 from Pawel Kobylak.
1 parente016b72 commite39feb1

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

‎doc/src/sgml/func.sgml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7151,16 +7151,19 @@ SELECT EXTRACT(SECOND FROM TIME '17:12:28.5');
71517151
<listitem>
71527152
<para>
71537153
The number of the week of the year that the day is in. By definition
7154-
(<acronym>ISO</acronym> 8601), the first week of a year
7155-
contains January 4 of that year. (The <acronym>ISO</acronym>-8601
7156-
week starts on Monday.) In other words, the first Thursday of
7157-
a year is in week 1 of that year.
7154+
(<acronym>ISO</acronym> 8601), weeks start on Mondays and the first
7155+
week of a year contains January 4 of that year. In other words, the
7156+
first Thursday of a year is in week 1 of that year.
71587157
</para>
71597158
<para>
7160-
Because of this, it is possible for early January dates to be part of the
7161-
52nd or 53rd week of the previous year. For example, <literal>2005-01-01</>
7162-
is part of the 53rd week of year 2004, and <literal>2006-01-01</> is part of
7163-
the 52nd week of year 2005.
7159+
In the ISO definition, it is possible for early-January dates to be
7160+
part of the 52nd or 53rd week of the previous year, and for
7161+
late-December dates to be part of the first week of the next year.
7162+
For example, <literal>2005-01-01</> is part of the 53rd week of year
7163+
2004, and <literal>2006-01-01</> is part of the 52nd week of year
7164+
2005, while <literal>2012-12-31</> is part of the first week of 2013.
7165+
It's recommended to use the <literal>isoyear</> field together with
7166+
<literal>week</> to get consistent results.
71647167
</para>
71657168

71667169
<screen>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp