Re: Time manipulation..

From: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
To: "Williams, Travis L, NPONS" <tlw(at)att(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Time manipulation..
Date: 2002-11-12 20:18:00
Message-ID: Pine.LNX.4.33.0211121316280.24879-100000@css120.ihs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 12 Nov 2002, Williams, Travis L, NPONS wrote:

> If I have a date/time column using timestamp.. how can I manipulate the date/time easily.. like take the date/time and add 7 days to it and get the correct date.. or subtract 5 days.. or anything like that.. I can do it all in perl (which I have done in the past).. but I hate dealing with month/year roll overs..

Assuming you have a date field, you should be able to do something like
this:

select datefield + 7 from table where id=1;

to get the date plus 7 days.

I tested it this time, and it seems to work in 7.2.3 as well as 7.3 beta.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Robert Treat 2002-11-12 20:23:00 Re: Max connections
Previous Message scott.marlowe 2002-11-12 20:11:33 Re: how do i insert a default value?