String to ZonedDateTime

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)
import java.time.format.DateTimeFormatter

rule "test1"
when
  // Time cron '* * * * * *'
then
  val time = "2022-08-02 10:01:02"
  val formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")
  val dateTimeFromString = LocalDateTime.parse(time, formatter).atZone(ZoneId.systemDefault())
end

Thanks! working perfect.