Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Calculate Time
#1
How to calculate time?

start 8:30 o'clock
end 15:00 o'clock
pause 30 minutes

time-worked-hours-and-minutes=(end -start in minutes) - pause

can you show me example code please?
i guess DateTime should be used?
pi
#2
If stored in variables, can use operator -.

vDiff=vEnd-vBegin-vPause
#3
Gintaras,

Can you return to this VERY SIMPLE example and actually provide the code for this. I have a need that is precisely laid out here. I HAVE spent a lot of time attempting to work through the documentation for DateTime BUT it is pretty cryptic for my mind! Sorry!

start 8:30 o'clock
end 15:00 o'clock
pause 30 minutes
Total time =

AND AS ALWAYS, 'Thank You!'
#4
Macro Macro2777
Code:
Copy      Help
long vStart vEnd vPause vDiff
vStart=TimeSpanFromStr("8:30")
vEnd=TimeSpanFromStr("15:00")
vPause=TimeSpanFromStr("0:30")
vDiff=vEnd-vStart-vPause
out TimeSpanToStr(vDiff)
Macro Macro2778
Code:
Copy      Help
DateTime vStart vEnd
vStart.FromStr("2016-01-06 8:30")
vEnd.FromStr("2016-01-06 15:00")
long vPause=TimeSpanFromStr("0:30")
long vDiff=vEnd-vStart-vPause
out TimeSpanToStr(vDiff)
#5
THANKS YOU!!!


Forum Jump:


Users browsing this thread: 1 Guest(s)