Re: Problem with Day of Week

From: "Ross J(dot) Reedstrom" <reedstrm(at)rice(dot)edu>
To: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
Cc: Keith Perry <keith(at)vcsn(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Problem with Day of Week
Date: 2001-02-05 16:53:15
Message-ID: 20010205105315.C9675@rice.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Mon, Feb 05, 2001 at 05:15:47PM +0100, Karel Zak wrote:
>
> test=# select date_part('dow','2001-02-11'::timestamp);
> date_part
> -----------
> 0
>
> test=# select to_char('2001-02-11'::timestamp, 'D');
> to_char
> ---------
> 1
>
>
> date_part is based on zero - use range 0-6
> to_char is based on one - use range 1-7
>

My understanding is that one is ISO, the other is for Oracle
compatability, is that not right Karel?

Ross

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message keith 2001-02-05 16:56:49 Re: Problem with Day of Week
Previous Message Karel Zak 2001-02-05 16:15:47 Re: Problem with Day of Week