Hi all

I need to calculate the time between 2 datetime, when the check-out date is 24:00:00, I get an error It only works if the start is 11:59:00,

any suggestions?


Code:
Function FechaDTimeDiferencia1 Global  Returns DateTime 
    DateTime dFechaTime  dFechaTime1
    Date dfecha   
    String sDiferencia

    move "01/01/2021" to dFecha
   Move (DateSetMillisecond(dFecha, 00)) To dFechaTime
   Move (DateSetSecond(dFechaTime, 00))  To dFechaTime
   Move (DateSetMinute(dFechaTime,00))   To dFechaTime
   Move (DateSetHour(dFechaTime, 22))    To dFechaTime
 
   
   Move (DateSetMillisecond(dFecha, 00)) To dFechaTime1
   Move (DateSetSecond(dFechaTime1, 00))  To dFechaTime1
   Move (DateSetMinute(dFechaTime1,00))   To dFechaTime1
   Move (DateSetHour(dFechaTime1, 24))    To dFechaTime1  
   
   Move (dFechaTime1-dFechaTime) to sDiferencia     
  
    
End_Function
Edgar