Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I am trying to create an employee timecard as a first project in VB but need help calculating between start and end time with a lunch break in the middle. I am using Visual Basic 2008
Posted

1 solution

You can subtract two DateTime objects. Try laterDateTime.Subtract(earlierDateTime). That will produce a TimeSpan object that has properties like "TotalSeconds" and "TotalMilliseconds".
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900