Re: Time manipulation..

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: "Williams, Travis L, NPONS" <tlw(at)att(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Time manipulation..
Date: 2002-11-13 01:08:55
Message-ID: 20021113010855.GA1126@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Nov 12, 2002 at 14:35:26 -0500,
"Williams, Travis L, NPONS" <tlw(at)att(dot)com> 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..

You can use intervals to do this. Intervals can specify a time difference
in years and months as well as days, hours, seconds, etc. The documentation
doesn't indicate which part is added first. A quick check indicates
that month, year gets added before day, hours, minutes, seconds, but
you might want to double check the code before relying on this.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Doug McNaught 2002-11-13 01:39:28 Re: JDBC question: Creating new arrays
Previous Message Corey Gibbs 2002-11-13 00:05:29 Good Job and Kudos to the Postgres Team