![]() ![]() T20:59:31-08:00 (with :) and throwing the exception -> : Text 'T20:59:31-08:00' could not be parsed at index 19Īs per my understanding from Wikipedia, both the dates seem to be in ISO 8601 format and should be converted via a single parser. I was able to solve this problem using the updated parser below: var date = OffsetDateTime.parse("T20:59:31-0800", DateTimeFormatter.ofPattern("uuuu-MM-dd'T'HH:mm:ssZ")) īut this is not helping as this parser is now not converting the first date i.e. ![]() > : Text 'T20:59:31-0800' could not be parsed, unparsed text found at index 22 var date = OffsetDateTime.parse("T20:59:31-0800") // no `:` in the zone offset This works totally fine but there are some dates in the list that don't have : in the Zone offset, therefore, I am getting the following exception from the parser. I have a list of ISO 8601 date strings that I want to parse and convert to OffsetDateTime.īelow is how I am converting: var date = OffsetDateTime.parse("T20:59:31-08:00") ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |