Re: BUG #1217: wrong date->number of week conversion

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Romuald Pilitowski" <rpilitow(at)galera(dot)ii(dot)pw(dot)edu(dot)pl>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1217: wrong date->number of week conversion
Date: 2004-08-13 03:29:16
Message-ID: 17319.1092367756@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"PostgreSQL Bugs List" <pgsql-bugs(at)postgresql(dot)org> writes:
> Frankly speaking I don`t know the adequate calendar ISO norm in detail, but
> the last days of year shouldn`t be counted as F_I_R_S_T week of that year. I
> expected PostgreSQL rather to return 2003-53-29.

You are mistaken.

The ISO week is defined as Mon-Sun where week 1 of a year is the week
containing the year's first Thursday. Don't ask me *why* it's defined
that way, but it is. 2004's first Thursday is Jan 1, so that week
extends from 2003-12-29 to 2004-01-04.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Martin Münstermann 2004-08-13 09:50:24 Re: [BUGS] 8.0.0beta1: -lpthread missing
Previous Message Zeki Mokhtarzada 2004-08-13 02:53:20 Primary key duplicates