Hello, need help...
How to sort it by time and date?
List look's like this
How to sort it by time and date?
List look's like this
B4X:
OPZJN7-RNVKA-GTVHN7 - 01:13:25 - 12.02.2022
OZJE4I-GY2VI-JZR2D5 - 19:17:24 - 17.02.2022
OY4GIP-Y2YPE-3G6E4M - 14:01:47 - 12.02.2022
OA7TGH-KHPDE-TIIZ5C - 14:05:56 - 12.02.2022
OKLODM-UHBJA-TNUOTH - 22:57:14 - 11.02.2022
ORBRR4-ZBULM-U2WSCR - 17:37:48 - 13.02.2022
OX6FPA-NJR4D-UGYKPI - 23:48:52 - 02.03.2022
OXOB4J-DTSMQ-A2LEDF - 00:12:52 - 12.02.2022
OBNHPX-BMCOC-BGL25O - 11:25:44 - 13.02.2022
OOKP6V-4OGDC-E7BHHX - 23:31:14 - 11.02.2022
OK3IOZ-TIJHB-COI45B - 09:25:53 - 05.04.2022
OOMJAO-6BICL-4FEVZ4 - 22:47:30 - 11.02.2022
B4X:
Dim s As Long
s = DateTime.Now
Log("Operation sort MAP started...")
For i = 0 To closed.Size - 1
DateTime.DateFormat = "dd.MM.yyyy"
DateTime.TimeFormat = "HH:mm:ss"
Dim time As String
If closed.GetValueAt(i).As(Map).ContainsKey("opentm") Then
time = closed.GetValueAt(i).As(Map).Get("opentm")
time = time.Replace(".","")
time = time.SubString2(0,10)
Dim unixtime As Long = time
Dim targetDate As Long = DateUtils.UnixTimeToTicks(unixtime)
Log(closed.GetKeyAt(i) & " - " & DateTime.Time(targetDate) & " - " & DateTime.Date(targetDate))
End If
Next
Log("Operation took: " & (DateTime.Now - s) & " ms")