Re: Simplicity in time/date functions

Поиск
Список
Период
Сортировка
От Vince Vielhaber
Тема Re: Simplicity in time/date functions
Дата
Msg-id Pine.BSF.4.40.0201031509320.19504-100000@paprika.michvhf.com
обсуждение исходный текст
Ответ на Simplicity in time/date functions  ("Ben-Nes Michael" <miki@canaan.co.il>)
Список pgsql-general
On Thu, 3 Jan 2002, Ben-Nes Michael wrote:

> 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 ?

template1=# select now() - 28;
  ?column?
------------
 12-06-2001
(1 row)

template1=#

That's with 7.1.2, as someone else pointed out your original way
works in 7.2.

Vince.
--
==========================================================================
Vince Vielhaber -- KA8CSH    email: vev@michvhf.com    http://www.pop4.net
         56K Nationwide Dialup from $16.00/mo at Pop4 Networking
        Online Campground Directory    http://www.camping-usa.com
       Online Giftshop Superstore    http://www.cloudninegifts.com
==========================================================================




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

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