I have a line of code which consists of two variables. One is a string called "endTime" that is formated like 05:00 PM the other is a string called "overTime" that is formated like "1". What I am trying to do is subtract the overTime from the endTime. I have the following line that converts the strings to Dates, however the subtraction returns 12:00 AM, but I am expecting 04:00 PM. Here is the code line:
Can anyone tell me what I am doing wrong and how I should go about it?
Code:
timeDiff = CDate(endTime) - Hour(CDate(overTime))
Comment