Re: Date addition/subtraction

From: "Dinesh Pandey" <dpandey(at)secf(dot)com>
To: "'Craig Bryden'" <postgresql(at)bryden(dot)co(dot)za>, "'pgsql'" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Date addition/subtraction
Date: 2005-05-04 04:08:40
Message-ID: 20050504041232.995BA534BF@svr1.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Select current_timestamp - '30 day'::interval
Select current_timestamp - '1 hour'::interval

Thanks
Dinesh Pandey

-----Original Message-----
From: pgsql-general-owner(at)postgresql(dot)org
[mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of Craig Bryden
Sent: Tuesday, May 03, 2005 11:02 PM
To: pgsql
Subject: [GENERAL] Date addition/subtraction

Hi

How in postgres can I do date/time subtraction or addition.
e.g. If I want to get today's date - 30 days? or current_timestamp - 1 hour?

Thanks
Craig

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
message can get through to the mailing list cleanly

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Lipy Reis 2005-05-04 04:21:44 Postgre 8.0 for Linux i586
Previous Message Keith Worthington 2005-05-04 03:58:28 Re: [INTERFACES] calculated identity field in views, again...