Hi, I am using visual studio 2012 and c++ language to create a windows form that serves as a time card for employees. I'm stuck in the part where I subtract the lunch time span from the total hours worked that day. In short, I'm trying to subtract two string which come from total hours worked and total lunch time text boxes. Those two values from the text boxes originate from four date time picker boxes, who's values where converted to string in order to be able to be displayed in those two text boxes. Below is a link to show how the program looks.
Do I have to convert the string back again? I've tried but get an error, also as you can see in the link's image, the text box values are numbers stored as a string from the datetimepicker who's format is datetime.
If you don't have a time class that'll do the conversion for you, you'll need to convert the strings to some numeric type, do the calculation and convert the result back to a string.