Ver Mensaje Individual
  #5 (permalink)  
Antiguo 19/10/2012, 13:25
chcma
 
Fecha de Ingreso: junio-2003
Ubicación: Asturias
Mensajes: 2.429
Antigüedad: 20 años, 11 meses
Puntos: 7
Respuesta: Restar dos Date, no funciona correctamente....

Al final lo solucioné restando una hora... a tomar por saco. xD

Código:
    //timeParking: Parametro que indica la fecha y hora en la que se inicio el Parking.
    function UpdateTimeLabelUI(timeParking) {

        var currentDate = new Date();

        var elapsedTime = new Date(currentDate.getTime() - timeParking.getTime());

        elapsedTime.setHours(elapsedTime.getHours() - 1);

        $('#lblControlTime').html('Parking: ' + elapsedTime.format("H:MM:ss"));
    }
__________________
Charlie.