Calculating time duration problem
<p>I am unable to get the duration properly.Actually i m using configuration class were i ll be mentioning which kind of time format to be taken.If i give HH:mm a format duration is not getting correct value.If i give it in HH:mm format it will give properly. </p>

<pre><code>  function autoChangeDuration()
    {
        alert("Entering Duration script");
        var start=document.getElementById("startTime").value;
                    alert("start time="+start);

        var end=document.getElementById("endTime").value;
                     alert("end time="+end);
                     var space1=start.split(' ');
                      var space2=end.split(' ');
                       s = space1[0].split(':');
         e = space2[0].split(':');
        // s = start.split(':');
        // e = end.split(':');
                    alert("s="+s);
                    alert("e="+e);
        var diff;

             min = e[1]-s[1];
            hour_carry = 0;
            if(min &lt; 0)
        {
                 min += 60;
                hour_carry += 1;
            }
            hour = e[0]-s[0]-hour_carry;
            diff = hour + ":" + min;
                     alert("duration="+diff);
        document.getElementById("duration").value=diff;
                    alert("start time="+start);
                     alert("end time="+end);
                      alert("duration="+diff);
    }
</code></pre>
