Re: How can I get the first and last date of a week, based on the week number and the year

From: brian <brian(at)zijn-digital(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: How can I get the first and last date of a week, based on the week number and the year
Date: 2008-02-27 03:21:04
Message-ID: 47C4D720.7090309@zijn-digital.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Bruno Baguette wrote:
> Hello !
>
> I have a week number (ISO 8601) and a year, based on theses values, I
> would like to get the first and the last dates of that week.
>
> How I can do that ?
>
> The only solution is doing a big generate_series to build a subset that
> contains the week of all the dates between the 01/01 || year and the
> 31/12 || year. But I find that solution quite dirty and ressources
> consumming.
>
> Is there a cleanest way to do that ?
>

Use pl/Perl and the Date::Calc module.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tim Uckun 2008-02-27 03:44:43 UUID-OSSP for windows.
Previous Message Adrian Klaver 2008-02-27 03:10:27 Re: How can I get the first and last date of a week, based on the week number and the year