Re: Setting week starting day

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Jorge Godoy <jgodoy(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Setting week starting day
Date: 2007-03-09 19:02:31
Message-ID: 20070309190231.GA2235@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Mar 09, 2007 at 14:59:35 -0300,
Jorge Godoy <jgodoy(at)gmail(dot)com> wrote:
> It is not hard to calculate, as you can see... but it would be nice if
> "date_trunc('week', date)" could do that directly. Even if it became
> "date_trunc('week', date, 4)" or "date_trunc('week', date, 'Wednesday')" it
> would be nice... :-) And that is what I was trying to ask ;-)

Use date_trunc('week', current_day + 1) and date_trunc('dow', current_day + 1)
to have a one day offset from the standard first day of the week.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sven Willenberger 2007-03-09 19:24:48 Re: Anyone know a good opensource CRM that actually installs with Posgtres?
Previous Message Scott Marlowe 2007-03-09 18:57:32 Re: "oracle to postgresql" conversion