As I was writing an explanation of how we use the usermodel to extract dates from cells in a sheet, I found the error causing the 1904 dates to be misinterpreted. We should have used Cell's getDateCellValue method instead of working with the double returned from getNumericCellValue.
Thank you for your help! -----Original Message----- From: Nick Burch [mailto:[email protected]] Sent: Wednesday, November 03, 2010 12:21 PM To: POI Users List Subject: Re: Detecting 1904 date windowing in a given file On Wed, 3 Nov 2010, Carnow, Robin (IMS) wrote: > I have been researching for a while now and I am unable to find a good > solution for finding out whether a given xls or xlsx file is using 1904 > date windowing (i.e. cells with dates created using excel on a mac). Are you using HSSF usermodel, or the low level records? If you're using the usermodel, then it ought to be handling the 1904 stuff for you. > I have tried to create a RecordInputStream and pass it to the > constructor of the DateWindow1904Record You shouldn't need to construct a record for it by hand, it'll either be there already or not. Nick --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] Information in this e-mail may be confidential. It is intended only for the addressee(s) identified above. If you are not the addressee(s), or an employee or agent of the addressee(s), please note that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender of the error. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
