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? ^..^
check this demo please, i wrote a demo for you, you can use it;
http://jsfiddle.net/BSeN6/2/