[Python-es] Como resto dos horas? datetime.time

Diego Uribe Gamez diego.uribe.gamez en gmail.com
Jue Jul 5 01:44:33 CEST 2012


la cuestión es que las horas se tienen que restar entre si:

(datetime.time(11, 23, 19),datetime.time(11, 14))

para tener la diferencia de horas

El 4 de julio de 2012 18:42, Eduardo Matus <ematus en gmail.com> escribió:

> from datetime import time, timedelta
> d = date.today() - timedelta(hours=2)
>
>
> 2012/7/4 Diego Uribe Gamez <diego.uribe.gamez en gmail.com>
>
>> Me sale este error cuando intento restar estas dos horas directamente:
>>
>> unsupported operand type(s) for -: 'datetime.time' and 'datetime.time'
>>
>> como hago para restar satisfactoriamente dos horas con datetime.time?
>>
>>
>> --
>>  *Diego Alonso Uribe Gamez*
>> ------------------------------
>>
>> *Desarrollador web*
>>
>> Twitter: @DiegoUG <http://www.twitter.com/DiegoUG>
>>
>> Google+: http://gplus.to/diegoug
>> ------------------------------
>>
>>
>>
>> _______________________________________________
>> Python-es mailing list
>> Python-es en python.org
>> http://mail.python.org/mailman/listinfo/python-es
>> FAQ: http://python-es-faq.wikidot.com/
>>
>>
>
>
> --
> Eduardo Matus Coquelet
> Ingeniero Civil Informático y Telecomunicaciones.
> Celular: 77113825
>
> _______________________________________________
> Python-es mailing list
> Python-es en python.org
> http://mail.python.org/mailman/listinfo/python-es
> FAQ: http://python-es-faq.wikidot.com/
>
>


-- 
 *Diego Alonso Uribe Gamez*
------------------------------

*Desarrollador web*

Twitter: @DiegoUG <http://www.twitter.com/DiegoUG>

Google+: http://gplus.to/diegoug
------------------------------
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://mail.python.org/pipermail/python-es/attachments/20120704/fe608b65/attachment.html>


Más información sobre la lista de distribución Python-es