B4J Question DateTimeParseException

le_toubib

Active Member
Licensed User
Longtime User
B4X:
 DateTime.DateFormat="dd-MM-yyyy"
datedone = DateTime.DateParse(tmpstr2)

hi i m using this code to parse the date string tmpstr2 , this = 17-05-2006
but i get this error in the log ,
java.time.format.DateTimeParseException: Text '17-05-2006' could not be parsed at index 0

what am i missing?
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
B4X:
Sub AppStart (Form1 As Form, Args() As String)
    MainForm = Form1
    'MainForm.RootPane.LoadLayout("Layout1") 'Load the layout file.
    MainForm.Show
    DateTime.DateFormat="dd-MM-yyyy"
    Dim datedone As Long = DateTime.DateParse("17-05-2006")
    Log(datedone)
End Sub
works for me using B4J 3.0 beta1
 
Upvote 0
Top