Problem working with dates and times. - Mailing list pgsql-general

From Alejandro Michelin Salomon \( Adinet \)
Subject Problem working with dates and times.
Date
Msg-id !~!UENERkVCMDkAAQACAAAAAAAAAAAAAAAAABgAAAAAAAAAhx491Ki2tUS42D/aMPFg1MKAAAAQAAAAbsMnEB0imUmFBn2mJIzLuwEAAAAA@adinet.com.uy
Whole thread Raw
Responses Re: Problem working with dates and times.  ("Raymond O'Donnell" <rod@iol.ie>)
Re: Problem working with dates and times.  (Michael Glaesemann <grzm@seespotcode.net>)
List pgsql-general
Hi :
 
I have some problems working with date and times, in my web page.
 
I have table with tasks.
This table has :
 
Inicial date
Inicial hour
Duration
Final Date
Final time
 
Final Date and Final time are calculate based in Inicial date, Inicial hour, Duration.
 
In my test:
Inicial date  2000-12-04
Inicial hour  20:00
Duration      5 (Hours)
 
Final time = time '"Inicial Hour"' + interval '"Duration" hours'
Ex: Final Time is --> time '20:00' + interval '5 hours' ===> 01:00  ( OK )
 
The problem cames when i try to add the duration to Inicial date.
 
if i execute this select :
select '2006-12-04 20:00'::timestamp + interval '5 hours'
the result is ok ( 2006-12-05 01:00:00 )
 
But i only need 2006-12-05 from the resulting timestamp.
 
How to cut only the date from this timestamp?
 
Thanks in advance
 
Alejandro Michelin Salomon

pgsql-general by date:

Previous
From: "Brandon Aiken"
Date:
Subject: Re: n00b RAID + wal hot standby question
Next
From: "Raymond O'Donnell"
Date:
Subject: Re: Problem working with dates and times.