Hi,
I've a problem with a procedure. I've different results in two different mobiles
This is the code
I'm adding minutos into an hour.
20:52 + 17 minutes (hdescanso) in my Xiaomi gives = 21:09 and the same numbers in an Oppo the result is = 20:09.
Any idea?
Thank you very much indeed in advance for your help.
Cheers
I've a problem with a procedure. I've different results in two different mobiles
This is the code
B4X:
Private Sub DimeHoraConducirOtraVez(hdescanso As Int) As String
Dim Hr1,Hr2, Hf As Long
Dim sh As String
DateTime.TimeFormat = "HH:mm"
Hr1 = DateTime.TimeParse(EdtFinal.Text)
Hr2 = DateTime.TimeParse("00:"&hdescanso)
Hf = Hr1 + Hr2
' Log(DateTime.GetHour(Hr1)&" + "&DateTime.GetHour(Hr2))
' Log("Hora suma hr1 + hr2: "&DateTime.Time(Hf))
Dim HoraArreglada, MinutoArreglado As String
HoraArreglada = DateTime.GetHour(Hf)
MinutoArreglado = DateTime.GetMinute(Hf)
If HoraArreglada.Length = 1 Then HoraArreglada = "0"&DateTime.GetHour(Hf)
If MinutoArreglado.Length = 1 Then MinutoArreglado = "0"&DateTime.GetMinute(Hf)
sh = HoraArreglada &":"& MinutoArreglado
Return sh
End Sub
I'm adding minutos into an hour.
20:52 + 17 minutes (hdescanso) in my Xiaomi gives = 21:09 and the same numbers in an Oppo the result is = 20:09.
Any idea?
Thank you very much indeed in advance for your help.
Cheers