What would be the code for finding the time difference between two different times which are in a 12hr format using javascript. I am using these two time fields in my dynamic gridview .
var gridNew = document.getElementById("<%= Gridview1.ClientID %>");
if (gridNew.rows.length > 0) {
for (i = 0; i < gridNew.rows.length - 2; i++) {
var frombox = document.getElementById("Gridview1_txtFrom_" + (i));
var tobox = document.getElementById("Gridview1_txtTo_" + (i));
if(frombox.value<=tobox.value){
alert("Enter valid time set");
return false;