JodaTime - IllegalArgumentException:无效格式:"Mon, 29 Oct 2018 15:17:19 +0000"

JodaTime - IllegalArgumentException: Invalid format: "Mon, 29 Oct 2018 15:17:19 +0000"

我在尝试解析日期时收到来自单个设备的崩溃

class DateTimeUtils {
  public static DateTime toDateTime(String value) {
     return DateTime.parse(value, DateTimeFormat.forPattern("EEE, d MMM yyyy HH:mm:ss Z"));
  }
}

堆栈跟踪

Caused by java.lang.IllegalArgumentException: Invalid format: "Mon, 29 Oct 2018 15:17:19 +0000"
   at org.joda.time.format.DateTimeFormatter.parseDateTime(DateTimeFormatter.java:945)
   at org.joda.time.DateTime.parse(DateTime.java:160)
   at com.example.app.DateTimeUtils.toDateTime(DateTimeUtils.java:58)

有什么想法吗?

问题已通过将区域设置设置为与要解析的日期的区域设置相同(在本例中为美国)解决。发生崩溃的设备不同。

DateTime.parse(value, DateTimeFormat.forPattern("EEE, d MMM yyyy HH:mm:ss Z").withLocale(Locale.US));