RE: Find all the dates in the calendar week? - Mailing list pgsql-general

From Karel Zak
Subject RE: Find all the dates in the calendar week?
Date
Msg-id Pine.LNX.3.96.1000706150155.14481B-100000@ara.zf.jcu.cz
Whole thread Raw
In response to RE: Find all the dates in the calendar week?  ("Andrew Snow" <als@fl.net.au>)
Responses Re: Find all the dates in the calendar week?  (Helge Haugland <helland@geocities.com>)
List pgsql-general
On Thu, 6 Jul 2000, Andrew Snow wrote:

> > See the documentation at:
> > http://www.comptechnews.com/~reaster/postgres/functions2976.htm
>
>
> So, something like:
>
> SELECT event FROM events WHERE to_char(CURRENT_TIMESTAMP, 'ww') =
> to_char(eventdate, 'ww');

 A small note about 'WW' in to_char/timestamp(), in 7.0 is a small bug
in this code (already discussed) and it is based on standard weeks, but in
7.1 it will *different* and based on weeks like Oracle (already in CVS).

Oracle: first week start JAN-1 and all next weeks start in same day. For
example if first day of year is friday, all weeks start in friday.

ISO-week: week that has more than 4 day and start in Sunday.

In future I try implement 'IW' that is ISO-week, but now I work on different
things.

In current 7.0 is probably better for week operations use
date_part('week', TIMESTAMP) than to_char().

                        Karel


pgsql-general by date:

Previous
From: The Hermit Hacker
Date:
Subject: Re: PostgreSQL & the BSD License
Next
From: Thomas Lockhart
Date:
Subject: Re: change in now() and ago with 7.x