Skip site navigation (1) Skip section navigation (2)

Re: how do i add a number of days to now()?

From: Michael Glaesemann <grzm(at)myrealbox(dot)com>
To: stig erikson <stigerikson_nospam_(at)yahoo(dot)se>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: how do i add a number of days to now()?
Date: 2005-12-21 05:32:34
Message-ID: 2AA723FC-3B46-415A-BE41-0B829A896FB9@myrealbox.com (view raw or flat)
Thread:
Lists: pgsql-novice
On Dec 18, 2005, at 20:44 , stig erikson wrote:

> my problem is, how do i make postgresql understand that i want to  
> add 2 days to the current time?

test=# select current_timestamp as "now"
	, current_timestamp + 2 * interval '1 day' as "2 days from now";
               now              |        2 days from now
-------------------------------+-------------------------------
2005-12-21 14:31:58.338283+09 | 2005-12-23 14:31:58.338283+09
(1 row)

Michael Glaesemann
grzm myrealbox com




In response to

pgsql-novice by date

Next:From: A. KretschmerDate: 2005-12-21 06:03:28
Subject: Re: Static Variables in PL/PGSQL
Previous:From: max chinDate: 2005-12-21 02:46:37
Subject: Questions about server.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group