title: Convert DateTime in String to LocalDateTime with TimeZone in Java
body: <p>I am trying to convert the <strong>String</strong> which is in the format: <strong>2020-11-23T14:28:45.237Z</strong> to <strong>LocalDateTime</strong> using <strong>DateTimeFormatter</strong> as below:</p>
  <pre><code>String dateTimeInString = &quot;2020-11-23T14:28:45.237Z&quot;;
  
  final DateTimeFormatter formatter = DateTimeFormatter.ofPattern(&quot;yyyy-MM-dd HH:mm:ss.SSSZ&quot;);
  LocalDateTime timestamp = LocalDateTime.parse(dateTimeInString, formatter);
  </code></pre>
  <p>But it's giving an exception. Need a guidance on this. Thanks!</p>