Re: Date addition/subtraction

From: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
To: Craig Bryden <postgresql(at)bryden(dot)co(dot)za>
Cc: pgsql <pgsql-general(at)postgresql(dot)org>
Subject: Re: Date addition/subtraction
Date: 2005-05-03 17:52:12
Message-ID: 1115142732.13303.1500.camel@state.g2switchworks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 2005-05-03 at 12:32, Craig Bryden wrote:
> 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?

select now()-interval'1 hour'

and so on.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2005-05-03 17:53:19 Re: Sorting by constant values
Previous Message Arcane_Rhino 2005-05-03 17:51:36 unsubscribe