Android Question [SOLVED] Date to ticks

Discussion in 'Android Questions' started by makis_best, Jul 22, 2019.

  1. makis_best

    makis_best Active Member Licensed User

    Hi.

    I try to parse a date to a DatePicker.
    The date format is yyyy-MM-dd.
    I try using the code
    Code:
    DateTime.DateFormat = "yyyy/MM/dd"
            AnotherDatePicker1.Date = 
    DateTime.DateParse(Curs1.GetString("InsDate"))
    But I always get the error java.text.ParseException: Unparseable date: "2019-07-22" (at offset 4)

    Why?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    The date string doesn't match the set format.

    Change the format to yyyy-MM-dd
     
    emexes likes this.
  3. makis_best

    makis_best Active Member Licensed User

    Perfect

    Works now...

    Thank you.
     
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