I have a string 2022-08-02 10:00:00
, and I want to convert it to ZoneDateTime so I can do date time manipulations.
I tried these things, but are all giving errors:
val DateTimeFromString = ZonedDateTime.parse(time).withZoneSameInstant(ZoneId.systemDefault())
val SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss")
val DateTime DateTimeFromString = new DateTime(formatter.parse(time))
val DateTimeFromString = new ZonedDateTime(time)