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

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Bugzilla from bugzilla@apache.org
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: [hidden email]
          Reporter: [hidden email]
  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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

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

--- Comment #1 from PJ Fanning <[hidden email]> ---
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: [hidden email]
For additional commands, e-mail: [hidden email]