Counting and recording time

mpm174

Member
Joined
Oct 24, 2007
Messages
8
Programming Experience
Beginner
I am new to programming and am taking a class for the final project I want to create a program that keeps track of employee time...rite now i am just thinking of recording the two times and then using an equation to calculate hours..is there a better way?
 
You can certainly just store the current time at the start and end of a shift and subtract one from the other. That's exactly what you would do if the shift had no breaks. The result of the subtraction would be a TimeSpan object, which has properties to tell you how many days, hours, minutes and seconds elapsed.
 
You would need to use TimeSpan object
Its very simple to use
heres an example
VB.NET:
dim timeDiff as TimeSpan
timeDiff = time1 - time2
 
Back
Top