Re: Inconsistent results when calculating "age" of db records

Поиск
Список
Период
Сортировка
От Ghislain LEVEQUE
Тема Re: Inconsistent results when calculating "age" of db records
Дата
Msg-id 5010ECF4.6090506@clarisys.fr
обсуждение исходный текст
Ответ на Inconsistent results when calculating "age" of db records  (Raheem Sarcar <raheemm1@yahoo.com>)
Ответы Re: Inconsistent results when calculating "age" of db records  (Raheem Sarcar <raheemm1@yahoo.com>)
Список psycopg
Le 26/07/2012 08:11, Raheem Sarcar a écrit :

> I get the following output -->
> 11:24:47.082  (which is correct)
>  [...]
>  From which I get the following result -->
> datetime.timedelta(-1, 45312, 918000).
>
>
> I then apply the formula "t.seconds/3600" and get the result "12" hrs (which is incorrect).

Did you forget do take into account the days member of your timedelta ?

-1 day + 12 hours = 12 hours


--
Ghislain LEVEQUE - Clarisys Informatique
http://www.clarisys.fr - 09 72 11 43 60


В списке psycopg по дате отправления:

Предыдущее
От: Raheem Sarcar
Дата:
Сообщение: Inconsistent results when calculating "age" of db records
Следующее
От: Daniele Varrazzo
Дата:
Сообщение: Re: Inconsistent results when calculating "age" of db records