Skip to content

Commit 19e0609

Browse files
author
Evan Fossier
committed
Fix exception parsing rfc2822 dates for some locales, always use us locale
1 parent a01f460 commit 19e0609

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/com/twilio/converter/DateConverter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.twilio.converter;
22

3+
import java.util.Locale;
34
import org.joda.time.DateTime;
45
import org.joda.time.DateTimeZone;
56
import org.joda.time.LocalDate;
@@ -16,7 +17,7 @@ public class DateConverter {
1617
DateTimeFormat.forPattern(DATE_PATTERN).withZone(DateTimeZone.UTC);
1718

1819
private static final DateTimeFormatter RFC2822_DATE_TIME_FORMATTER =
19-
DateTimeFormat.forPattern(RFC2822_DATE_TIME).withZone(DateTimeZone.UTC);
20+
DateTimeFormat.forPattern(RFC2822_DATE_TIME).withZone(DateTimeZone.UTC).withLocale(new Locale("en_US"));
2021

2122
private static final DateTimeFormatter ISO8601_DATE_TIME_FORMATTER =
2223
DateTimeFormat.forPattern(ISO8601_DATE_TIME).withZone(DateTimeZone.UTC);

0 commit comments

Comments
 (0)