Good morning my query is the following in two Datetime I capture a start date and a final date, at the time of saving my final date in the database I need you to save me a data type Float with the difference of those two dates in hours I make a comparison but always ne yields the same result -1.
public void botonTerminarTiempo() {
tiempos.setFechaHoraFinal(fechaActual);
tiemposFacade.edit(tiempos);
Date fechaInicial = tiempos.getFechaHoraInicio();
Date fechaFinal = tiempos.getFechaHoraFinal();
Integer resultadoFecha;
resultadoFecha = fechaInicial.compareTo(fechaFinal);
tiempos.setTotalHoraHombre(resultadoFecha.floatValue());
tiemposFacade.edit(tiempos);
fechaActual = new Date();
laborSeleccionada = new Labor();
lineaSeleccionada = new Linea();
operarioSeleccionado = new Operarios();
ordentrabajo = new Ordentrabajo();
tiempos = new Tiempos();
}