Problem working with dates and times.

Поиск
Список
Период
Сортировка
От Alejandro Michelin Salomon \( Adinet \)
Тема Problem working with dates and times.
Дата
Msg-id !~!UENERkVCMDkAAQACAAAAAAAAAAAAAAAAABgAAAAAAAAAhx491Ki2tUS42D/aMPFg1MKAAAAQAAAAbsMnEB0imUmFBn2mJIzLuwEAAAAA@adinet.com.uy
обсуждение исходный текст
Ответы 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>)
Список 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 по дате отправления:

Предыдущее
От: "Brandon Aiken"
Дата:
Сообщение: Re: n00b RAID + wal hot standby question
Следующее
От: "Raymond O'Donnell"
Дата:
Сообщение: Re: Problem working with dates and times.