Dim TM1, TM2, TM3 as long
TM1 = DateTime.Now
' wait about 10 seconds....
TM2 = DateTime.now
TM3 = TM2 - TM1
Label.text = DateTime.Time(TM3)
Think about it this way
.Time give you the time of day based on the ticks from 1970.
so to make it easy here your taking
1000 - 900 = 100
Now 100 is the different between 1000 and 900, now if you put that in the .Time it will give you the time 100 from 1970 not the amount of time between 1000 and 900.
Back to our question, TM3 is going to be 1000 for every second between TM1 and TM2
You can use
.GetHour(TM3)
.GetMinute(TM3)
.GetSecond(TM3)
so
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("main")
TM1 = DateTime.Now
End Sub
Sub Button1_Click
TM2 = DateTime.Now
Label1.Text = DateTime.GetMinute(TM2-TM1) '***Get the Total number of minutes in ticks 0 to 59****
Label1.Text = Label1.Text & ":" & DateTime.GetSecond(TM2 - TM1) '***Get the Seconds in Ticks 0 to 59 (MOD)****
End Sub
Hours is 0 to 24
Displays 2:33, 2 minutes and 33 seconds after the app starts