Re: Simplicity in time/date functions

Поиск
Список
Период
Сортировка
От Jason Earl
Тема Re: Simplicity in time/date functions
Дата
Msg-id 873d1n5go5.fsf@npa01zz001.simplot.com
обсуждение исходный текст
Ответ на Simplicity in time/date functions  ("Ben-Nes Michael" <miki@canaan.co.il>)
Ответы Re: Simplicity in time/date functions  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Simplicity in time/date functions  ("Roderick A. Anderson" <raanders@tincan.org>)
Список pgsql-general
Try:

processdata=> SELECT CURRENT_DATE - 28;
  ?column?
------------
 2001-12-06
(1 row)

Thomas could probably explain why this is.  I can't remember the
reasoning, I simply learned to stay away from these types of functions
(now(), current_date(), etc.).

Jason

"Ben-Nes Michael" <miki@canaan.co.il> writes:

> Hi All
>
> I was amazed that:
> select current_date() - 28 dont work at postgresql :(
>
> I checked here and there and found that in postgresql i need to do something
> like this:
>
> select current_date::TIMESTAMP - '28 days'::INTERVAL as date
>
> whow, is there a shorter way ?
>
> --------------------------
> Canaan Surfing Ltd.
> Internet Service Providers
> Ben-Nes Michael - Manager
> Tel: 972-4-6991122
> http://sites.canaan.co.il
> --------------------------
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org

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

Предыдущее
От: Frank Bax
Дата:
Сообщение: Re: Simplicity in time/date functions
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Simplicity in time/date functions