Like this:
REM ***** BASIC *****
Sub Main
ReDim a(6,3)
a(0,0 ) = "03/12/2021;16:20:00"
a(1,0 ) = "03/12/2021;16:19:00"
a(2,0 ) = "03/12/2021;16:19:01"
a(3,0 ) = "05/12/2021;16:20:00"
a(4,0 ) = "03/12/2021;16:20:00"
a(5,0 ) = "31/12/2021;16:20:00"
a(6,0 ) = "03/08/2021;14:45:35"
a(0,1) = "som"
a(1,1) = "som"
a(2,1) = "so§em"
a(3,1) = "soe1m"
a(4,1) = "soesm"
a(5,1) = "soeasdfm"
a(6,1) = "soeme"
Dim da(6)
for i = 0 to uBound(da())
Redim r(1)
s = a(i,0)
r(0) = mid(s, 7,4)&"-"& mid(s,4,2) &"-"& left(s,2) &" "& mid(s,12,8)
r(1) = a(i,1)
da(i)= r()
next i
sh = ThisComponent.Sheets.getByIndex(0)
rg = sh.getCellRangeByPosition(0, 0, 1, uBound(da()))
REM sh.getCellRangeByPosition(0, 0, 0, uBound(da())).CellStyle = "MyDateTime"
rg.setFormulaArray(da())
simpleSort rg, 0, True, False
End Sub
Sub simpleSort(oRange, iField%, bAsc as Boolean, bHeader as Boolean)
Dim oField as new com.sun.star.table.TableSortField
Dim oFieldsProp as new com.sun.star.beans.PropertyValue
Dim oHeaderProp as new com.sun.star.beans.PropertyValue
Dim aSortDescriptor()
oField.Field = iField
oField.IsAscending = bAsc
oFieldsProp.Name = "SortFields"
' array of c.s.s.table.TableSortField (we set one of max. 3):
oFieldsProp.Value = Array(oField)
' array of c.s.s.beans.PropertyValue
oHeaderProp.Name = "ContainsHeader"
oHeaderProp.Value = bHeader
aSortDescriptor() = Array(oHeaderProp, oFieldsProp)
oRange.sort(aSortDescriptor())
End Sub