Re: Simplicity in time/date functions

From: Vince Vielhaber <vev(at)michvhf(dot)com>
To: Ben-Nes Michael <miki(at)canaan(dot)co(dot)il>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Simplicity in time/date functions
Date: 2002-01-03 20:10:58
Message-ID: Pine.BSF.4.40.0201031509320.19504-100000@paprika.michvhf.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)michvhf(dot)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
==========================================================================

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jason Earl 2002-01-03 20:21:46 Re: Simplicity in time/date functions
Previous Message Frank Bax 2002-01-03 20:02:25 Re: Simplicity in time/date functions