B4J Question DateTimeParseException

le_toubib

Active Member
Licensed User
Longtime User
Code: Copy
 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?
 
Upvote 0
Code: Copy
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
Back
Top