datetime arithmatic

From: Stuart <sfbarbee(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: datetime arithmatic
Date: 2001-04-30 19:18:12
Message-ID: 3AEDBA74.D13EB066@yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Folks,

I am new to postgresql 7.1 and like what I see so far. How is datetime
arithmatic performed in postgres. I have a table with start date/time
and end date/time(datetime data type) fields and want to set the default
end time to 1 hour later than the start time. Is there a way to do
this. My attempts to set the default value for the field using:

starttime datetime default now(),
endtime datetime default now() + xxx.xxx,

has yielded only either a datetime with time set to 00:00 or only a
date!

Thanks for the help.

Stuart

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Al 2001-04-30 19:35:16 Problem installing Postgresql
Previous Message Tom Lane 2001-04-30 19:17:31 Re: PostgreSQL and mySQL database size question