File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
src/main/java/com/dropbox/core/stone Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 55import java .text .SimpleDateFormat ;
66import java .util .Date ;
77import java .util .GregorianCalendar ;
8+ import java .util .Locale ;
89import java .util .TimeZone ;
910
1011import com .fasterxml .jackson .core .JsonFactory ;
@@ -19,7 +20,7 @@ final class Util {
1920 private static final int SHORT_FORMAT_LENGTH = DATE_FORMAT .replace ("'" , "" ).length ();
2021
2122 public static String formatTimestamp (Date timestamp ) {
22- DateFormat format = new SimpleDateFormat (DATE_TIME_FORMAT );
23+ DateFormat format = new SimpleDateFormat (DATE_TIME_FORMAT , Locale . ENGLISH );
2324 format .setCalendar (new GregorianCalendar (UTC ));
2425 return format .format (timestamp );
2526 }
@@ -29,9 +30,9 @@ public static Date parseTimestamp(String timestamp) throws ParseException {
2930
3031 DateFormat format = null ;
3132 if (length == LONG_FORMAT_LENGTH ) {
32- format = new SimpleDateFormat (DATE_TIME_FORMAT );
33+ format = new SimpleDateFormat (DATE_TIME_FORMAT , Locale . ENGLISH );
3334 } else if (length == SHORT_FORMAT_LENGTH ) {
34- format = new SimpleDateFormat (DATE_FORMAT );
35+ format = new SimpleDateFormat (DATE_FORMAT , Locale . ENGLISH );
3536 } else {
3637 throw new ParseException ("timestamp has unexpected format: '" + timestamp + "'" , 0 );
3738 }
You can’t perform that action at this time.
0 commit comments