24-hour difference in time

24-hour difference in time

I have a function built that converts time into decimal.  The user inputs the time (e.g. 2:30) and it converts it a decimal equivalent:

float totalTime(string timeIN, string timeOUT)
{
    time = ((input.timeOUT.toTime("hh:mm") - input.timeIN.toTime("hh:mm"))  /  60000  /  60).round(2);
    return time;
}

The problem is that it doesn't support 24-hour time (e.g. 14:30).  Any times from 1:00 to 12:59 works but after that I get null. 

Is there an easy way to get this to work?