subtract first and last datetime of an array javascript
<p>I need to subtract the first and last element (dates) of an array wich i get from an XML file.</p>

<p>The string has the following format:</p>

<pre><code> 27/12/2012 13:09:15
 27/12/2012 13:40:47
 27/12/2012 14:56:43
</code></pre>

<p>does anyone know how to do the subtract?</p>

<p>best regards </p>

<p>My function is this:</p>

<pre><code> function recorrido() {

 downloadUrl("dates.asp", function(data) {
    var xml = xmlParse(data);
    var markersPath = xml.documentElement.getElementsByTagName("marker");   
    var path = [];


    for (var i = 0; i &lt; markersPath.length; i++) {
    var lat = parseFloat(markersPath[i].getAttribute("lat"));
    var lng = parseFloat(markersPath[i].getAttribute("lng"));
    var timestamp= markersPath[i].getAttribute("timestamp");

    var time = 0;
    time+= Math.abs(timestamp[0]) - Math.abs(timestamp[timestamp.length-1]);

}//finish loop

alert(time);
alert(timestamp[0]);
alert(timestamp[timestamp.length-1]);




}); //end download url
}//end function
</code></pre>

<p>and the xml whic loads dinamically is this one:</p>

<pre><code>&lt;markers&gt;
&lt;marker id="1" lat="37.1914496222793" lng="-3.72511240175617" timestamp="27/12/2012 16:37:03"/&gt;
&lt;marker id="2" lat="37.1914401951048" lng="-3.72517991386109" timestamp="27/12/2012 16:37:05"/&gt;
&lt;marker id="3" lat="37.1914308368611" lng="-3.72523615956726" timestamp="27/12/2012 16:37:07"/&gt;
&lt;marker id="4" lat="37.1914216855078" lng="-3.72525860611944" timestamp="27/12/2012 16:37:09"/&gt;
&lt;marker id="5" lat="37.1913854939084" lng="-3.72528079402709" timestamp="27/12/2012 16:42:38"/&gt;
&lt;marker id="6" lat="37.191367191181" lng="-3.72532568708827" timestamp="27/12/2012 16:42:40"/&gt;
&lt;/markers&gt;
</code></pre>

<p>So what I want to get is the time that the vehicle have been driving.</p>
