From: | "Gyozo Papp" <pgerzson(at)freestart(dot)hu> |
---|---|
To: | "Stuart" <sfbarbee(at)yahoo(dot)com>, <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: datetime arithmatic |
Date: | 2001-05-05 14:15:52 |
Message-ID: | 028101c0d56d$e4e5f080$4647c5d5@jaguar |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Maybe this helps you:
starttime datetime default now(),
endtime datetime default (now() + interval('1 hour'))
----- Original Message -----
From: "Stuart" <sfbarbee(at)yahoo(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Sent: 2001. április 30. 21:18
Subject: [GENERAL] datetime arithmatic
> 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
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
From | Date | Subject | |
---|---|---|---|
Next Message | Holger Klawitter | 2001-05-05 15:15:28 | Re: Trying to get jdbc to work |
Previous Message | Witold Rak | 2001-05-05 13:58:24 | How tnaslate kode from MySQL to Postgres? |