Re: date_trunct() and start of week - Mailing list pgsql-general

From Thomas Kellerer
Subject Re: date_trunct() and start of week
Date
Msg-id heo1t9$l8b$1@ger.gmane.org
Whole thread Raw
In response to Re: date_trunct() and start of week  (Rikard Bosnjakovic <rikard.bosnjakovic@gmail.com>)
Responses Re: date_trunct() and start of week  (Thomas Markus <t.markus@proventis.net>)
List pgsql-general
Rikard Bosnjakovic, 27.11.2009 08:49:
> [...]
>> I'm just curious which setting defines whether monday or sunday is
>> considered the "first day in a week"
>
> Read 9.9.2 on http://www.postgresql.org/docs/8.1/static/functions-datetime.html
> and you will see that even if you find such setting, date_trunc() will
> always return monday as start of week:
>
> =========[snip]
> source is a value expression of type timestamp or interval. (Values of
> type date and time are cast automatically, to timestamp or interval
> respectively.) field selects to which precision to truncate the input
> value. The return value is of type timestamp or interval with all
> fields that are less significant than the selected one set to zero (or
> one, for day and month).
> =========[snip]
>
> Atleast that's how I interpret the last parenthesis in the paragraph.

Hmm, I don't see that in there.

It just states that the field will be set to "zero". But does zero refer to a Monday or a Sunday?

Regards
Thomas



pgsql-general by date:

Previous
From: Rikard Bosnjakovic
Date:
Subject: Re: date_trunct() and start of week
Next
From: "bbhe"
Date:
Subject: return value for PQbinaryTuples