Here is how you can convert Java LocalDateTime to ZonedDatime.
Java LocalDateTime store only date time information without any timezone information. You can convert it to a ZonedTime with time zone information.
ZonedDateTime zonedDateTime = localDateTime.atZone(ZoneId.systemDefault())
.withZoneSameInstant(ZoneOffset.UTC);
Comments