Hello,
I have been working on a time clock program where the user can enter their time in and time out using two DateTimePickers, and it will tell them how many hours and minutes they worked. I was able to format the DateTimePicker to only show the hours and minutes. However, in my result it show's it with the hours, minutes, and seconds(hh:mm:ss) Ex. (08:00:47). I would like my result to only return the hours and minutes. Here is my code thus far:
Any help wouls be much appreciated, if you need any more info let me know.
Thank's soo much in Advanced!
~Scarlett
'Formats DateTimePicker for TimeIn to display only Hours and Minutes
dtpTimeIn.CustomFormat = "hh:mm tt M/dd/y"
dtpTimeIn.Format = DateTimePickerFormat.Custom
dtpTimeIn.ShowUpDown = True
'Formats DateTimePicker for TimeOut to display only Hours and Minutes
dtpTimeOut.CustomFormat = "hh:mm tt M/dd/y"
dtpTimeOut.Format = DateTimePickerFormat.Custom
dtpTimeOut.ShowUpDown = True
End Sub
'Code for calculate button
Dim dailyHrs As String
dailyHrs = txtDailyHrs.Text
'Displays answer as hh:mm:ss
txtDailyHrs.Text = ((dtpTimeOut.Value - dtpTimeIn.Value).ToString())