Re: Problem with Day of Week

Поиск
Список
Период
Сортировка
От Karel Zak
Тема Re: Problem with Day of Week
Дата
Msg-id Pine.LNX.3.96.1010205170718.29540F-100000@ara.zf.jcu.cz
обсуждение исходный текст
Ответ на Problem with Day of Week  (Keith Perry <keith@vcsn.com>)
Ответы Re: Problem with Day of Week  ("Ross J. Reedstrom" <reedstrm@rice.edu>)
Re: Problem with Day of Week  (<keith@vcsn.com>)
Список pgsql-sql
On Mon, 29 Jan 2001, Keith Perry wrote:

> Greetings,
> 
> I notice some talk about date problems and interestingly enough planning
> out an application in which I will need to be able to manipulate dates.
> I notice however that there seems to be a discrepancy with the day or
> week in 7.0.3
> 
> ---
> 
> pmhcc=# select date_part('dow','now'::timestamp);
>  date_part
> -----------
>          1
> (1 row)
> 
> pmhcc=# select to_char('now'::timestamp,'D');
>  to_char
> ---------
>  2
> (1 row)
> 
See:

test=# select date_part('dow','2001-02-11'::timestamp);date_part
-----------        0

test=# select to_char('2001-02-11'::timestamp, 'D');to_char
---------1date_part is based on zero - use range 0-6to_char is based on one - use range 1-7
    Karel



В списке pgsql-sql по дате отправления:

Предыдущее
От: Michael Davis
Дата:
Сообщение: RE: Hrm...why is this wrong?
Следующее
От: "Brian C. Doyle"
Дата:
Сообщение: Re: Problem with Day of Week