Subject Re: extract(week from d)
Author lacakus
> but as Helen pointed out, you have to tell your requirements
*exactly*.
> E.g. 1-1-2006 is Sunday, so according to iso standard
> it actually belongs to last week of 2005. What restul do you expect
> this week-function to return ?

I prefer following ISO 8601 standard, so 2006-01-01 belongs to last
week of 2005 and First week of 2006 begins with 2006-01-02.
Exactly so as in my paper-calender on my desk :-)

PostgreSQL documentation says:
By definition (ISO 8601), the first week of a year contains January 4
of that year. (The ISO-8601 week starts on Monday.) In other words, the
first Thursday of a year is in week 1 of that year.

-Laco.