Hi,

in the code we have some places where we reset the default time zone [1], like 
the following:

        TimeZone cet = TimeZone.getTimeZone("Europe/Copenhagen");
        TimeZone.setDefault(cet);

Although this is just in a junit test, I don't think it's a good idea to set 
the jdk default.
I've added a new ThreadLocal to DateUtil and although I'm not convinced, that 
this
is a definite solution, at least it's pragmatical:

    @BeforeClass
    public static void setTimeZone() {
        userTimeZone = DateUtil.getUserTimeZone();
        DateUtil.setUserTimeZone(TimeZone.getTimeZone("CET"));
    }

Another solution would be, to guess the TimeZone by parsing date cells in the 
workbook
and compare them to the stored string values ... of course this only applies to 
X/HSLF.

What do you think about it?

Andi.



[1] org.apache.poi.hssf.usermodel.TestHSSFDateUtil


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

Reply via email to