Calculate Hours Between two Date/Time Strings(YYYY-mm-dd HH:MM:SS) using Javascript
<p>I have two Time Stamps in the following Format:</p>

<pre><code>Start Time  - 2016-01-01 00:00:00 
Finish Time - 2016-01-02 23:15:00
</code></pre>

<p>I need to calculate the number of hours between the two date times correct to two decimal places.</p>

<p>I need the result to be in the following format</p>

<pre><code>Hrs = 47.25
</code></pre>

<p>This would be 23 hours and .25 of an hour not 25 mins, I do not need to round to the nearest 15 I only need to round to 2 decimal places.</p>

<p>Any Help shall be much appreciated. This data will then be inserted back into a cell in a DHTMLX grid.</p>

<p>FINAL SOLUTION</p>

<pre><code>adminGrid.attachEvent("onEditCell",function(stage,rId,cInd,nValue,oValue){
                if ((cInd == colStartTime || cInd == colFinishTime) &amp;&amp; stage == 2) {
                    var startTime = new Date(adminGrid.cells(rId,colStartTime).getValue());
                    var finishTime = new Date(adminGrid.cells(rId,colFinishTime).getValue());
                    var Hrs = ((finishTime - startTime)/1000/60/60).toFixed(2);
                    adminGrid.cells(rId,colHrs).setValue(Hrs);                      
                }
                return true;
            });
</code></pre>