← Back to team overview

openerp-expert-production team mailing list archive

Re: [Bug 794207] Re: MRP operations time precission to seconds

 

Hi,
Yes, I think its best to convert to seconds first
and then compute what you need.

I don't understand why openerp does not use
the unix timestamp instead.

Thank you,
Vishal Khialni

On Wednesday 31 October 2012 09:45 AM, jordg wrote:
Why is hours a float value?
Would it be easier to have it in seconds?
It is realy easy to manipulate values as seconds.

I tried the suggestion above which works for the client however the web
needs to work also.

But I cannot see how to get hh:mm:ss out of a float value. Maybe someone
can enlighten me.

How to add seconds to this????
client/6.1/bin/tools/datetime_util.py
def float_time_convert(float_val):
         hours = math.floor(abs(float_val))
         mins = round(abs(float_val)%1+0.01,2)
         if mins >= 1.0:
             hours = hours + 1
             mins = 0.0
         else:
             mins = mins * 60
         float_time = '%02d:%02d' % (hours,mins)
         return float_time

Is it better to convert it all to seconds???





References