i have two textbox..TimeInTextbox that contains time in for example(8:00 am) and TimeOutTextbox that contains time out for example(5:00 pm), i want to add TimeInTextbox and TimeOutTextbox to get the total working hours but how am i suppposed to do that?

me.textbox1.text =Now

commented: Wrong and useless. -2

The above response merely displays the current date and time. To calculate the difference between two date/time values you do the following:

txtTimeWorked.Text = DateDiff(DateInterval.Minute, CDate(txtTimeIn.Text), CDate(txtTimeOut.Text))

Assuming that the two fields used in the calculation both contain valid date/time values, it returns the elapsed time in minutes (in the event you want to allow credit for partial hours).

Is there an hour attribute in the DateInterval? Because he said he want to get the hours rendered.

Yes but that won't account for partial hours. When I work 8.5 hours I expect to get paid for 8.5 hours.

Ahh. Thanks for answering.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.