You can't work with dates like that.
Try the following instead:
var time1input = "04:00";
var time2input = "08:00";
var time1 = new Date("01/01/2013 " + time1input);
var time2 = new Date("01/01/2013 " + time2input);
var difference = time2.getTime() - time1.getTime();
console.log(difference / 60 / 60 / 1000); //<- whittle this down to hours
That will log out '4'.
If you're working with times, use something like http://momentjs.com/, which lets you do cool stuff like..
difference = moment(time2).diff(time1, 'hours'); //<- will return 4
Format (hh:mm): (assuming use of difference from first example)
var hours = Math.floor(difference / 60 / 60 / 1000);
var minutes = Math.round(difference / 60 / 1000) % 60;
var formattedString = (hours > 10 ? hours : "0" + hours) + ":" + (minutes > 10 ? minutes : "0" + minutes);
A 4 hour difference will return "04:00", a 13 hour, 30 minute difference will return 13:30.