How to get hours and minutes from 'datetime.timedelta' object?

John Machin sjmachin at lexicon.net
Mon Aug 7 16:22:03 EDT 2006


Ant wrote:
> John Machin wrote:
> ...
> > 1. If that's what he wanted, it was a very peculiar way of asking. Do
> > you suspect that he needs to be shown how to conver 877.7... minutes
> > into hours, minutes and seconds???
>
> Chill dude, It wasn't an attack :-)

I didn't think it was.

>
> The datetime class has hour, minute and second attributes that give the
> values of each as being in range(24) (hours) and range(60). i.e.
> integers. So an educated guess leads me to the conclusion that it is
> similar functionality that he wants from the timedelta class.
>
> > 2. Please consider that the order of the result would be more
> > conventionally presented as (hours, minutes, seconds) -- or do you
>
> Very good point. That would have been a tricky issue for the OP, and
> for that I apologise.
>
> > suspect that the OP needs it presented bassackwards?
>
> I think that you have that last word muddled. Not quite ass-backward,
> but close ;-)

On the contrary. It means "ass-backward, and then some". Google
"dictionary bassackwards" and read the first few hits. 

Cheers,
John




More information about the Python-list mailing list