Re: AW: Re: Week number

From: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
To: Roland Roberts <roland(at)astrofoto(dot)org>
Cc: Hackers List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: AW: Re: Week number
Date: 2001-03-15 09:58:11
Message-ID: 20010315105810.A28603@ara.zf.jcu.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Mar 14, 2001 at 01:23:30PM -0500, Roland Roberts wrote:
> >>>>> "AZ" == Zeugswetter Andreas SB <ZeugswetterA(at)wien(dot)spardat(dot)at> writes:
>
> >> 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".
>
> AZ> Germany and Austria have Monday as first day of week, I think
> AZ> most of Europe also.
>
> I believe the goal was to have a to_char() that was complete and
> Oracle-compatible. Perhaps we need to also have a trunc() which is

Yes, an Oracle-compatiblity is important for masks (format pictures)
used in both (Ora and PG). But our PG's implementation has some extensions,
for example 'ID' ISO-day-of-week in 7.2 where Monday = first day of week.
I hope all countries will glad :-)

for 'WW' and 'D' are results same:

Ora:

SVRMGR> select to_char( to_date('2001/03/12', 'YYYY/MM/DD'), 'WW Day D
YYYY/MM/DD') from dual;
TO_CHAR(TO_DATE('2001/03/
-------------------------
11 Monday 2 2001/03/12
1 row selected.

PG:

select to_char( to_date('2001/03/12', 'YYYY/MM/DD'), 'WW Day D YYYY/MM/DD');
to_char
---------------------------
11 Monday 2 2001/03/12
(1 row)

Karel

--
Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
http://home.zf.jcu.cz/~zakkr/

C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Joel Quinet 2001-03-15 11:18:39 Problem build python extension on Unixware
Previous Message Denis Perchine 2001-03-15 09:50:53 Re: Database corruption in 7.0.3