Bug 54767 - Need to express non-existent date
Summary: Need to express non-existent date
Status: RESOLVED INVALID
Alias: None
Product: POI
Classification: Unclassified
Component: POI Overall (show other bugs)
Version: 3.8-FINAL
Hardware: PC Windows Server 2003
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-29 12:54 UTC by alex
Modified: 2013-03-29 13:17 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description alex 2013-03-29 12:54:10 UTC

    
Comment 1 alex 2013-03-29 13:08:37 UTC
I have a requirement that does not seem easy to implement:

The jvm uses Europe/Paris as its default timezone.
We need to put a list of dates into the excel and the list contains an hour that does not exist in that timezone: 2013-03-31T02:00:00

If we have a list of date objects which contain say "01:00, 02:00, 03:00", the excel will show "01:00, 03:00, 04:00" because the internal calendar uses the default timezone.

Our current workaround is to inject the dates not as java.util.Date objects but rather as numbers. To transform the dates to numbers we use the method org.apache.poi.ss.usermodel.DateUtil.getExcelDate(Calendar date, boolean use1904windowing) and pass in a calendar that is set in UTC.

Am I missing something? Can I change the timezone of the internal Calendar or am I doing something wrong? Is it possible to expose the timezone settings of said calendar instead of using the default one?
Comment 2 Nick Burch 2013-03-29 13:17:06 UTC
Please ask usage questions on the mailing lists - http://poi.apache.org/mailinglists.html