Hello group, I’m having problems in taking a data value from a listbox in the format dd / mm / yyyy and using it by passing it to a variable of type date, the string that gives me an error is this:
messagebox "My data" + datetime.FromString(dareavere.ListBoxDare.CellTextAt(row,3)).SQLDateTime
where am I wrong?
I think I understand that I should convert the date back to the YYYY-MM-DD format first?
Depends all on the input Format and the Locale Format.
Maybe this will help:
Var Berlin As New Locale("de-DE")
Var NewYork As New Locale("en-US")
Try
MessageBox "My data " + DateTime.FromString("11/03/2022 13:33:00", NewYork).SQLDateTime
MessageBox "My data " + DateTime.FromString("03.11.2022 13:33:10", Berlin).SQLDateTime
MessageBox "My data " + DateTime.FromString("2022-11-03 13:33:10", Berlin).SQLDateTime // This should fail...
Catch err As RuntimeException
// Wrong Format
End Try