DateTimeParseException - could not be parsed at index 0
问题 I'm trying to parse the following date "Wed, 26 Feb 2020 03:42:25 -0800" String datePattern = "EEE, dd MMM yyyy HH:mm:ss Z"; DateTimeFormatter formatter = DateTimeFormatter.ofPattern(datePattern); ZonedDateTime zonedDateTime = ZonedDateTime.parse(dateStr, formatter); But i get the following error: java.time.format.DateTimeParseException: Text 'Wed, 26 Feb 2020 03:42:25 -0800' could not be parsed at index 0 Thanks 回答1: You need to provide a Locale that uses the language used by the date String