org.threeten.bp zonedDateTime.parse does not work

31 Views Asked by At

Hi I am trying to use org.threeten.bp library and format a date string to zonnedDateTime but it does not work.

   val dateFormatter: DateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd")
        val aOne = ZonedDateTime.parse("2022-08-11", dateFormatter)

I am using import org.threeten.bp.* library.

error I get is

org.threeten.bp.format.DateTimeParseException: Text '2022-08-11' could not be parsed: Unable to obtain ZonedDateTime from TemporalAccessor: DateTimeBuilder[, ISO, null, 2022-08-11, null], type org.threeten.bp.format.DateTimeBuilder

could you suggest what I am doing wrong here please

Thanks R

0

There are 0 best solutions below