Hi, I use POI 3.17 version. And i found that the formated date cell for instance allways follow the current locale. Analysis : With "this.localeIsAdapting = true;" in the constructor with 3 arguments we can never set localsAdapting to <code>false</code> in the Construstor with 2 arguments. it will always be <code>true</code> for field localIsAdapting. in "this(locale, false, emulateCSV);" //snipppet org.apache.poi.ss.usermodel.DataFormatter ------------- /** * Creates a formatter using the given locale. * * @param emulateCSV whether to emulate CSV output. */ public DataFormatter(Locale locale, boolean emulateCSV) { this(locale, false, emulateCSV); } /** * Creates a formatter using the given locale. * @param localeIsAdapting (true only if locale is not user-specified) * @param emulateCSV whether to emulate CSV output. */ private DataFormatter(Locale locale, boolean localeIsAdapting, boolean emulateCSV) { this.localeIsAdapting = true; localeChangedObservable.addObserver(this); // localeIsAdapting must be true prior to this first checkForLocaleChange call. localeChangedObservable.checkForLocaleChange(locale); // set localeIsAdapting so subsequent checks perform correctly // (whether a specific locale was provided to this DataFormatter or DataFormatter should // adapt to the current user locale as the locale changes) this.localeIsAdapting = localeIsAdapting; this.emulateCSV = emulateCSV; } Best Regards, Rochemont Patrice.
Resolved in trunk and will appear in 4.0.0 release. https://github.com/apache/poi/commit/a611b66fd195952c6262cb5eb49da1a740cf2aaa
Why not enable to use the exact locale used when creating the cell style in the document ? see https://stackoverflow.com/a/51939623/10252155