B4J Question DateTimeParseException

Discussion in 'B4J Questions' started by le_toubib, May 2, 2015.

  1. le_toubib

    le_toubib Active Member Licensed User

    Code:
    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?
     
  2. DonManfred

    DonManfred Expert Licensed User

    Showing what exactly is inside tmpstr2
     
  3. le_toubib

    le_toubib Active Member Licensed User

    tmpstr2 = 17-05-2006
     
  4. DonManfred

    DonManfred Expert Licensed User

    Code:
    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
     
  5. le_toubib

    le_toubib Active Member Licensed User

    thanks
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice