Ver Mensaje Individual
  #5 (permalink)  
Antiguo 04/05/2015, 01:06
Avatar de Profesor_Falken
Profesor_Falken
 
Fecha de Ingreso: agosto-2014
Ubicación: Mountain View
Mensajes: 1.323
Antigüedad: 9 años, 8 meses
Puntos: 182
Respuesta: Como restar time

Cita:
No me resta.
Tienes que convertir los milisegundos a horas, minutos y segundos. Por tanto:

Código Java:
Ver original
  1. this.jTextField3.setText(String.format("%02d:%02d:%02d", TimeUnit.MILLISECONDS.toHours(resta),
  2.     TimeUnit.MILLISECONDS.toMinutes(resta) % TimeUnit.HOURS.toMinutes(1),
  3.     TimeUnit.MILLISECONDS.toSeconds(resta) % TimeUnit.MINUTES.toSeconds(1)));
Esto deberia funcionar.

Un saludo
__________________
If to err is human, then programmers are the most human of us