I have recently changed from org.joda.time
package to
java.time
package and I am wondering how the two differ
in using a default locale.
Locale is used when parsing dates;
the java.time
seems to use the system language and country as the default
locale while the
joda.time
uses null,
which I can see using
java.time.format.DateTimeFormatter.ISO_DATE.getLocale
org.joda.time.format.DateTimeFormat.fullDateTime().getLocale
en_US
null
The Joda documentation on the getLocale() states
/**
* Gets the locale that will be used for printing and parsing.
*
* @return the locale to use; if null, formatter uses default locale at
* invocation time
*/
public Locale getLocale() {
return iLocale;
}
Which says it's using the default locale at invocation time. Is this default always English "en"? If I change the language on my system, java time wont parse English dates, while Joda time still accepts it.