I need to subtract two 24-hour time values from 0 to 23 using JQuery.
e.g. , 01:00 - 03:00 should return 22:00 hours
but my function's not working
function TimeDiff()
{
var start=$('#fTime').val();
var end = '03:00';
var diff=(start-end+24)%24;
$('#bReg').val(diff);
}
Do I need to do some sort of conversion to Time object or ...?
Any ideas? ^..^
String
doesn't magically become aDate
object :PDate
s, or convert the hours/minutes to numbers and do the math manually.