I am trying to convert the String which is in the format: 2020-11-23T14:28:45.237Z to LocalDateTime using DateTimeFormatter as below:
String dateTimeInString = "2020-11-23T14:28:45.237Z";
final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSSZ");
LocalDateTime timestamp = LocalDateTime.parse(dateTimeInString, formatter);
But it's giving an exception. Need a guidance on this. Thanks!