You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2020/02/14 12:50:21 UTC

[Bug 64143] New: Custom date formats rely on JVM user locale instead of LocaleUtil in DataFormatter

https://bz.apache.org/bugzilla/show_bug.cgi?id=64143

            Bug ID: 64143
           Summary: Custom date formats rely on JVM user locale instead of
                    LocaleUtil in DataFormatter
           Product: POI
           Version: 4.1.1-FINAL
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: POI Overall
          Assignee: dev@poi.apache.org
          Reporter: jjlharrison@me.com
  Target Milestone: ---

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 64143] Custom date formats rely on JVM user locale instead of LocaleUtil in DataFormatter

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64143

--- Comment #1 from PJ Fanning <fa...@yahoo.com> ---
would have time to look at doing a patch?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org