year and weeknumbers (proposal included) - Mailing list pgsql-bugs

From joost@snow.nl
Subject year and weeknumbers (proposal included)
Date
Msg-id 20030127210914.EF12C1460862@intern.snow.nl
Whole thread Raw
List pgsql-bugs
hi,

last year (2002) the date december 31st is in week 1 of 2003.

it is not possible to get this out of a date-column using EXTRACT or
to_char.
         to_char( '2002-12-31', 'WW' ) returns 1, and
         to_char( '2002-12-31', 'YYYY' ) returns 2002 (as expected)!

the format for retrieving the year with respect to week-numbering
could be something like IY, IYY, IYYY, IYYYY.

         to_char( '2002-12-31', 'IYYYY' ) returns 2003.

regards,

Joost Helberg
--
Joost Helberg
Technisch Directeur Snow BV http://snow.nl Tel 0418-653333 Fax 0418-653666
Voorzitter VOSN         http://www.vosn.nl Tel 0418-653336 Fax 0418-653666
GPG PblKey fprnt= 738C 20AC A545 02AE 6F5D  5A9F D724 EB4B 2B10 150B

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: recent (just got from cvs) build doesn't run nicely
Next
From: Żak, Sławomir
Date:
Subject: Bug in LIKE operator processing