|Summary:||Custom date formats rely on JVM user locale instead of LocaleUtil in DataFormatter|
|Product:||POI||Reporter:||James Harrison <jjlharrison>|
|Component:||POI Overall||Assignee:||POI Developers List <dev>|
Description James Harrison 2020-02-14 12:50:21 UTC
The DataFormatter class creates a new ExcelStyleDateFormatter for custom date formatting which is a subclass of SimpleDateFormat. However, it never calls setTimeZone which means it relies on the user.timezone and cannot be overridden. For the default date format, setTimeZone is called with the time zone from LocaleUtil, which allows for the zone to be overridden on a per-thread basis. I have a use case for reading formatted dates from an Excel file using as UTC, but this only works if the JVM user.timezone is set to UTC, which I cannot guarantee.
Comment 1 PJ Fanning 2020-02-14 12:58:00 UTC
would have time to look at doing a patch?