Re: Re: Week number - Mailing list pgsql-hackers

From Jim Mercer
Subject Re: Re: Week number
Date
Msg-id 20010314120038.Y4368@reptiles.org
Whole thread Raw
In response to AW: Re: Week number  (Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>)
Responses Re: Re: Week number  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
On Wed, Mar 14, 2001 at 04:54:54PM +0100, Zeugswetter Andreas SB wrote:
> > Unix day-of-week starts on Sunday, not Monday, which is what
> > date_trunc('dow',...) returns. Presumably this is modeled on the
> > traditional notion (at least in the US; I suspect this is true in most
> > European countries at least) of Sunday being "the first day of week".
> 
> Germany and Austria have Monday as first day of week, I think most of 
> Europe also.

it is all relative.

most western calendars that i have seen show "Sun Mon Tue Wed Thu Fri Sat".

the concept of "first" day of week is a bit muddied.

many christian-influenced places would consider Sunday to be the "first"
day of the week, but monday being the "first" business day of the week.

i have seen calendars which use "Mon Tue Wed Thu Fri Sat Sun", and i have
worked with people where saturday was the first day of business. and also
places where sunday is the first day of business.

so, suffice to say, there is no "proper" first day of the week.

as such, the unix day of week pegs sunday as day 0, your code should just
use that index.  since almost all cultures have now adapted to a 7 day week
and a 365 day year, there shouldn't bee too much confusion.

-- 
[ Jim Mercer          jim@pneumonoultramicroscopicsilicovolcanoconiosis.ca ]
[          Reptilian Research -- Longer Life through Colder Blood          ]
[ aka                        jim@reptiles.org              +1 416 410-5633 ]


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: AW: Shutdown term
Next
From: The Hermit Hacker
Date:
Subject: Re: pgmonitor patch for query string