Android Question What is the wrong in this code(diferent bet 2 Times) using DateUtils

Alhootti

Active Member
DateUtils:
Dim diff1 As Period
    DateTime.TimeFormat="hh:mm"
    diff1 = DateUtils.PeriodBetween.Hours(DateTime.TimeParse("05:10"),DateTime.Time(DateTime.Now))
    Label1.Text = diff1.Hours
 

Serge Bertet

Active Member
Licensed User
B4X:
    Dim diff1 As Period
    DateTime.TimeFormat="hh:mm"
    diff1 = DateUtils.PeriodBetween(DateTime.TimeParse("05:10"), DateTime.Time(DateTime.Now))
    Label1.Text = diff1.Hours
 
Upvote 0

Knoppi

Active Member
Licensed User
Longtime User
B4X:
Dim diff1 As Period
DateTime.TimeFormat="HH:mm  '<-- not "hh:mm"
diff1 = DateUtils.PeriodBetween(DateTime.TimeParse("05:10"), DateTime.Now)  ' removed DateTime.Time
Label1.Text = diff1.Hours
 
Last edited:
Upvote 0
Top