I have simple code, which parses string into date.
new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSSX").parse("2021-06-28T07:09:30.463931900Z")
It parses this string into Sat Jul 03 18:01:41 CEST 2021
, which is not valid.
When I remove from pattern 'SSSSSSSSSX'
, it starts working and returns: Mon Jun 28 07:09:30 CEST 2021
.
Problem is that I need nanoseconds, so I can not just get rid of this.
I found many similar topics, but any of them dealt with such date format.