var year = '2013';
var month = '04';
var day = '18';
var hour = '12';
var min = '35';
var reserv = new Date(year,month,day,hour,min)
console.log(reserv);
Those year, month and day values you might want to fetch for yourselves by checking the current date. This is purely to show how to convert the string into a date.
Use reserv.getTime()
to convert to milliseconds time and thus being able to compare two times;
reserv.getTime() - reserv2.getTime()
For more information, check the MDN.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…