ncgjiju
12th January 2009, 09:06
Hi.

for example i have i want to calculate the difference of 2 times in baan iv


regards,

George

ks_ks_
12th January 2009, 09:21
time.diff= utc.num()


days=round(time.diff/86400,0,0)
hours= round((time.diff-86400*days)/3600,0,0)
minutes=round((time.diff-86400*days-3600*hours)/60,0,0)
seconds=round((time.diff-86400*days-3600*hours-60*minutes),0,0)

NirajKakodkar
12th January 2009, 10:48
for example i have i want to calculate the difference of 2 times in baan iv


Hello George ,

There is no concept of time in Baan IV as far as I know , the date which is used in Baan IV is not of type UTC , so the solution which KS_KS has given wont work for Baan IV.

In Baan IV , day percentage is used to represent time .
so for example , if we take production order say "A"
and its start date is "12/01/08" and day% is 35% and
end date is "12/01/08" and day percentage is 60%.

what this means is the production order will start after 35% of the day and will get over till 60% of the day .

so the total time required in percentage is 25% of the total day , and if you want to calculate the number of hours , if we consider 24 hours as working hours/day , it will be 24*25% , i.e equal to 6 hours .. similarly you can calculate at what time it actually started and ended .

Hope this will helps you .

Regards,
Niraj

ks_ks_
13th January 2009, 09:02
I didnt notice the Baan iv. Yes, it will only work in Baan5 onwards.
Just wondering, will date() also not work in Baan iv?

NirajKakodkar
14th January 2009, 05:41
date.num() will work in Baan IV , the way it works in Baan 5 / LN .. ..
but this returns the number of days from 01-01-0001 to the system date.
and dont include the time component in it ..

ks_ks_
14th January 2009, 09:03
Thank You Neeraj

ncgjiju
23rd February 2009, 05:58
here how i sloved the problem

date1 = hhmmss
calc1 = (hh* 3600) + (mm*60) + ss
date2= hhmmss
calc2= (hh* 3600) + (mm*60) + ss

so the difference is diff = calc1 - calc2 ( time in secs)
there in minutes diff/60 ( will be time in minutes)

thanks for help and advice