title: How to parse UTC timestamp of format yyyy-MM-ddTHH:mm:ss.SSS+ZZZZ
body: <p>I have timestamp as <code>2020-12-03T05:35:59.398+0000</code> in <code>String</code> format being recieved in a streaming batch.</p>
  <p>I want only <code>2020-12-03 05:35:59</code> as <code>java.sql.Timestamp</code> instance in order to be able to compare it with other <code>Timestamp</code> instance.</p>
  <p>Getting following error with <code>Timestamp.valueOf()</code> function:</p>
  <pre><code>Exception in thread &quot;main&quot; java.time.format.DateTimeParseException : Text '2020-12-03T05:35:59.398+0000' could not be parsed at index 23
  </code></pre>
  <p>I tried the answer given <a href="https://stackoverflow.com/questions/50498949/how-to-convert-utc-date-string-and-remove-the-t-and-z-in-java">here</a> , and conversion did happen but the time was changed to <code>2020-12-03 11:05:59</code></p>
  <p>I have tried changing between the formats given <a href="https://help.sumologic.com/03Send-Data/Sources/04Reference-Information-for-Sources/Timestamps%2C-Time-Zones%2C-Time-Ranges%2C-and-Date-Formats" rel="nofollow noreferrer">here</a> but still no solution.</p>
  <p>Is there even a format for timestamp with wierd <code>+</code> in between <code>398+0000</code>?</p>