S
sd00
Hi all, can someone give me some coding help with a problem that
*should* be really simple, yet I'm struggling with.
I need the difference between 2 times (Target / Actual)
However, these times will fall somewhere between a Start & End time
Further more, there will be Break & Lunch times between Start & End.
Example...
Start 08:00
Break start 10:30
Break end 10:40
Lunch start 12:00
Lunch end 12:30
Break start 14:30
Break end 14:40
End 16:00
Target 10:12
Actual 10:36
Target vs. Actual (results)....
Real Time - 24 min
Production Time - 18 min
NOTES:
The solution will cater for any amount of delay e.g.
Target "1-Feb-06 14:23", Actual "2-Feb-06 11:52")
How I imagined I'd do this...
Dim ts as TimeSpanEx
ts.AddStart "1-Feb-06 08:00"
ts.AddStop "1-Feb-06 10:30"
ts.AddStart "1-Feb-06 10:40"
ts.AddStop "1-Feb-06 12:00"
ts.AddStart "1-Feb-06 12:30"
ts.AddStop "1-Feb-06 14:30"
ts.AddStart "1-Feb-06 14:40"
ts.AddStop "1-Feb-06 16:00"
ts.AddStart "2-Feb-06 08:00"
ts.AddStop "2-Feb-06 10:30"
ts.AddStart "2-Feb-06 10:40"
ts.AddStop "2-Feb-06 12:00"
ts.AddStart "2-Feb-06 12:30"
ts.AddStop "2-Feb-06 14:30"
ts.AddStart "2-Feb-06 14:40"
ts.AddStop "2-Feb-06 16:00"
Dim tsResult as TimeSpan
tsResult = ts.CalculateDuration("1-Feb-06 14:23", "2-Feb-06 11:52" )
....Just gotta figure out the contents of TimeSpanEx class!
I can create the AddStart & AddStop functions (store times in an array or list) but I
cannot for the life of me get a working CalculateDuration(Target, Actual) function going.
I hope the answer is so obvious & simple that I kick myself for days!
Thanks, Steve.
*should* be really simple, yet I'm struggling with.
I need the difference between 2 times (Target / Actual)
However, these times will fall somewhere between a Start & End time
Further more, there will be Break & Lunch times between Start & End.
Example...
Start 08:00
Break start 10:30
Break end 10:40
Lunch start 12:00
Lunch end 12:30
Break start 14:30
Break end 14:40
End 16:00
Target 10:12
Actual 10:36
Target vs. Actual (results)....
Real Time - 24 min
Production Time - 18 min
NOTES:
The solution will cater for any amount of delay e.g.
Target "1-Feb-06 14:23", Actual "2-Feb-06 11:52")
How I imagined I'd do this...
Dim ts as TimeSpanEx
ts.AddStart "1-Feb-06 08:00"
ts.AddStop "1-Feb-06 10:30"
ts.AddStart "1-Feb-06 10:40"
ts.AddStop "1-Feb-06 12:00"
ts.AddStart "1-Feb-06 12:30"
ts.AddStop "1-Feb-06 14:30"
ts.AddStart "1-Feb-06 14:40"
ts.AddStop "1-Feb-06 16:00"
ts.AddStart "2-Feb-06 08:00"
ts.AddStop "2-Feb-06 10:30"
ts.AddStart "2-Feb-06 10:40"
ts.AddStop "2-Feb-06 12:00"
ts.AddStart "2-Feb-06 12:30"
ts.AddStop "2-Feb-06 14:30"
ts.AddStart "2-Feb-06 14:40"
ts.AddStop "2-Feb-06 16:00"
Dim tsResult as TimeSpan
tsResult = ts.CalculateDuration("1-Feb-06 14:23", "2-Feb-06 11:52" )
....Just gotta figure out the contents of TimeSpanEx class!
I can create the AddStart & AddStop functions (store times in an array or list) but I
cannot for the life of me get a working CalculateDuration(Target, Actual) function going.
I hope the answer is so obvious & simple that I kick myself for days!
Thanks, Steve.