poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Suchitra Varma <sva...@flagstar.com>
Subject Regarding apache POI date formatting
Date Mon, 08 Feb 2010 21:40:17 GMT

I have an issue with the apache POI date formatting when I execute my 
application in the Unix environment. We have windows environment locally and 
then we promote to a testing environment which is Unix. I know the code that I 
wrote is correct because in my local my formatting works fine, I am trying to 
format the date as mm/dd/yyyy hh:mm:ss AM/PM. But in the unix environment, this 
does not happen. In Unix the formatting always is set to yyyy-mm-dd for the 
date columns.

I am using the following to SimpleDateFormat to parse the date in String format 
to a Date Format:

SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-mm-dd hh:mm:ss");

Then I set the excel style using HSSFCellStyle. Here I say the following:

HSSFCellStyle cellStyle = wb.createCellStyle();
            createHelper.createDataFormat().getFormat("m/d/yy h:mm"));

Now I set this style for the cells that requires the Date format.

As I said earlier all this works in Windows but seems to take no effect when 
run in Unix.

Has anyone come across this issue earlier.

Thanks and Best Regards

To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org

View raw message