What\'s wrong with the following code? It throws a ParseException with error offset 0.
final DateFormat df = new SimpleDateFormat(\"EEE MMM dd HH:mm:ss yyyy\");
SimpleDateFormat is absolutely locale-sensitive. Certain fields, like hours and minutes, are locale-independent.
SimpleDateFormatalso supports localized date and time pattern strings. In these strings, the pattern letters described above may be replaced with other, locale dependent, pattern letters.SimpleDateFormatdoes not deal with the localization of text other than the pattern letters; that's up to the client of the class.
Or, you can use the localization-friendly DateFormat#getDateInstance() factory method instead, since:
public SimpleDateFormat(String pattern, Locale locale)Constructs a
SimpleDateFormatusing the given pattern and the default date format symbols for the given locale. Note: This constructor may not support all locales. For full coverage, use the factory methods in the DateFormat class.
Source: https://stackoverflow.com/a/5174712/2591612