I am trying to parse dates in the format of EEE, dd MMM yyyy HH:mm:ss zzz, so for example strings like "Tue, 16 May 2017 07:44:48 GMT" using threeten's DateTimeFormatter. However, it seems that the time-zone name can't get parsed for some reason (I tried to parse the same string just without the time-zone name part and that worked).
Here is the parsing part of the code:
DateTimeFormatter parseFormatter = DateTimeFormatter.ofPattern("EEE, dd MMM yyyy HH:mm:ss z", Locale.ENGLISH);
ZonedDateTime parsedDate = ZonedDateTime.parse(date, parseFormatter);
And I get the following error:
org.threeten.bp.format.DateTimeParseException: Text 'Tue, 16 May 2017 13:02:16 GMT' could not be parsed at index 26
I tried all sorts of different formats for the time-zone name part (e.g. z, zzz, Z, ZZZ), but nothing worked. Again, if I parse a substringed date without the time-zone name part (into LocalDateTime), then it works, so I am sure that the problem is somehow with the time-zone name. Does anyone have any idea what the problem might be?