Re: BUG #13848: 2016 Week Number Error

Поиск
Список
Период
Сортировка
От John McKown
Тема Re: BUG #13848: 2016 Week Number Error
Дата
Msg-id CAAJSdjj6NrSoknbC-osBa-UAj3cTs8YbOc8JwdMmqi+nUM1EMw@mail.gmail.com
обсуждение исходный текст
Ответ на BUG #13848: 2016 Week Number Error  (maxk@yelp.com)
Список pgsql-bugs
On Tue, Jan 5, 2016 at 1:32 PM, <maxk@yelp.com> wrote:

> The following bug has been logged on the website:
>
> Bug reference:      13848
> Logged by:          Max Kulinich
> Email address:      maxk@yelp.com
> PostgreSQL version: 9.4.5
> Operating system:   OSX
> Description:
>
> SELECT EXTRACT(Week FROM current_date) =3D 1 instead of 2 Week numbers ar=
e
> all
> off
>

=E2=80=8BThis looks correct to me.

http://www.postgresql.org/docs/9.5/interactive/functions-datetime.html#FUNC=
TIONS-DATETIME-EXTRACT
<quote>
week

The number of the ISO 8601 week-numbering week of the year. By definition,
ISO weeks start on Mondays and the first week of a year contains January 4
of that year. In other words, the first Thursday of a year is in week 1 of
that year.

In the ISO week-numbering system, it is possible for early-January dates to
be part of the 52nd or 53rd week of the previous year, and for
late-December dates to be part of the first week of the next year. For
example, 2005-01-01 is part of the 53rd week of year 2004, and 2006-01-01 i=
s
part of the 52nd week of year 2005, while 2012-12-31 is part of the first
week of 2013. It's recommended to use the isoyear field together with week =
to
get consistent results.
</quote>

=E2=80=8BJan 1, 2016 was on =E2=80=8Ba Friday. The first Thursday of 2016 i=
s 7 Jan. ISO
calendars start on a Monday (unlike US calendars which start on a Sunday),
so the ISO first week of 2016 is Jan 4, 2016 to Jan 10, 2016.

--=20
Werner Heisenberg is driving down the autobahn. A police officer pulls
him over. The officer says, "Excuse me, sir, do you know how fast you
were going?"
"No," replies Dr. Heisenberg, "but I know where I am."

Computer Science is the only discipline in which we view adding a new wing
to a building as being maintenance -- Jim Horning

Schrodinger's backup: The condition of any backup is unknown until a
restore is attempted.

He's about as useful as a wax frying pan.

Maranatha! <><
John McKown

В списке pgsql-bugs по дате отправления:

Предыдущее
От: extra43@comcast.net
Дата:
Сообщение: BUG #13850: Need a parameter added similar to "edb_stmt_level_tx"
Следующее
От: Francisco Olarte
Дата:
Сообщение: Re: BUG #13848: 2016 Week Number Error