Re: Simplicity in time/date functions - Mailing list pgsql-general

From Darren Ferguson
Subject Re: Simplicity in time/date functions
Date
Msg-id Pine.LNX.4.10.10201031444200.16287-100000@thread.crystalballinc.com
Whole thread Raw
In response to Simplicity in time/date functions  ("Ben-Nes Michael" <miki@canaan.co.il>)
List pgsql-general
dev=> select current_date() - 28;
  ?column?
------------
 2001-12-06

Works for 7.2b

Darren


Darren Ferguson
Software Engineer
Openband

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 ?
>
> --------------------------
> 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 by date:

Previous
From: "Ben-Nes Michael"
Date:
Subject: Simplicity in time/date functions
Next
From: Vince Vielhaber
Date:
Subject: Re: Simplicity in time/date functions