https://issues.apache.org/bugzilla/show_bug.cgi?id=53092

             Bug #: 53092
           Summary: Add a Cell.getDateCellValue(TimeZone timezone) method
                    to allow user to specify required TimeZone for the
                    Date
           Product: POI
           Version: 3.8
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: POI Overall
        AssignedTo: [email protected]
        ReportedBy: [email protected]
    Classification: Unclassified


We encountered a problem in our application when reading a spreadsheet
containing a series of dates without any timezone information. These dates fell
on the first day of European Daylight Savings Time (March 25th, 2012):

For example:
25/03/2012 00:00
25/03/2012 01:00
25/03/2012 02:00
25/03/2012 03:00
25/03/2012 04:00

The application reading these dates runs on a server configured for the
Europe/Oslo timezone (which uses DST) but the application needs these dates
using the GMT calendar (which does not use DST).

So we first read the dates using Cell.getDateCellValue(), which returns a Date
using Oslo time (e.g. "25/03/2012 00:00 CET"). We then create a Calendar using
the GMT timezone and set the time values accordingly (e.g. resulting in
"25/03/2012 00:00 GMT"). But the problem occurs when we read the "special" hour
of 02:00, because when this is created as a Date using CET it is automatically
adjusted to CEST (i.e. "02:00" becomes "02:00 CET" which becomes "03:00 CEST"
which is actually "01:00 GMT"). We have worked around the problem by using the
getNumericCellValue() and manually parsing the Date ourselves, however it would
be much more convenient if we were able to specify the required TimeZone in the
first place, which would be used by the POI DateUtil.getJavaDate() method to
create a Calendar using the correct timezone in the first place.

We cannot simply change the default JVM TimeZone as the JVM is running several
instances of our application for several different timezones.

Should I create a patch, or is the aforementioned Use Case enough of a
description?

Kind Regards,
Gareth

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to