Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

              http://www.postgresql.org/docs/faq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux