Re: date_trunct() and start of week

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thomas Kellerer <spam_eater(at)gmx(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: date_trunct() and start of week
Date: 2009-11-27 15:20:40
Message-ID: 27291.1259335240@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thomas Kellerer <spam_eater(at)gmx(dot)net> writes:
> I'm just curious which setting defines whether monday or sunday is considered the "first day in a week"

A look at the source code (timestamptz_trunc) shows that truncation to
week start follows the ISO week conventions --- so weeks start on
Monday, regardless of locale.

Offhand I do not think that we pay attention to locale for any datetime
calculations. However, there are other places that use Sunday for week
start, so it does matter which calculation you ask for ...

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Daniel Schuchardt 2009-11-27 15:22:28 Access a Field / Column of a resultset by Number
Previous Message Shakil Shaikh 2009-11-27 13:33:46 Re: Invalid redo in checkpoint record