The 1 day = 24 hours. If you want to count 8 hours, per 24 hours, you could 
just divide by 3.

normal_hours = (delta.seconds / 60)
hours = normal_hours / 3 # And now you're counting 8 hours per day instead of 
24.

Or did you want to count a maximum of 8 hours per day started?
i.e. 2 days, 2 hours + 30 minutes would yield (2*8) + 2 + 0.5

Or something entirely different?

In order for me to help you, you have to give some background as to what you're 
trying to achieve and why, and please give as much detail as possible. (i.e. 
http://www.catb.org/~esr/faqs/smart-questions.html#beprecise) 
-- 
Tim ^,^
On Tuesday 17 May 2011 at 11:57, Tsolmon Narantsogt wrote: 
> delta  = 1 day 2:30:00
> how to get total hours from delta. but 1 day = 8 hour 
> 
> then  i'll run that code
> hours = delte.days * 8
> 
> 
> 
> 
> 
>  -- 
>  You received this message because you are subscribed to the Google Groups 
> "Python Ireland" group.
>  To post to this group, send email to [email protected].
>  To unsubscribe from this group, send email to 
> [email protected].
>  For more options, visit this group at 
> http://groups.google.com/group/pythonireland?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Python Ireland" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pythonireland?hl=en.

Reply via email to