Re: Validating the excel date for MM/dd/yyyy format

2014-04-25 Thread Renjith R
Since I am working at XSSF + SAX level, I am able to get the format of that particular cell by accessing the Styles table using the following code. XSSFCellStyle style = styles.getStyleAt(styleIndex); String formatString = style.getDataFormatString(); System.out.println(formatString); This gave m

RE: Validating the excel date for MM/dd/yyyy format

2014-04-25 Thread Crocker, David
Plus, don't forget the really useful utility, BuiltinFormats http://poi.apache.org/apidocs/org/apache/poi/ss/usermodel/BuiltinFormats.html -Original Message- From: Nick Burch [mailto:apa...@gagravarr.org] Sent: Friday, April 25, 2014 3:10 AM To: POI Users List Subject: Re: Validating th

Re: HSSFDataFormatter for Date values

2014-04-25 Thread Nick Burch
On Fri, 25 Apr 2014, Kilian Sprotte wrote: Nick Burch gagravarr.org> writes: If you, on a windows machine, switch the locale to USA and then open the file in Excel, does it look the same in Excel then as it does in POI now? (Excel does some transparent rewriting of format strings in some local

Re: HSSFDataFormatter for Date values

2014-04-25 Thread Kilian Sprotte
Nick Burch gagravarr.org> writes: > If you, on a windows machine, switch the locale to USA and then open the > file in Excel, does it look the same in Excel then as it does in POI now? > > (Excel does some transparent rewriting of format strings in some locales, > writing the US version to the

Re: Validating the excel date for MM/dd/yyyy format

2014-04-25 Thread Nick Burch
On Fri, 25 Apr 2014, Renjith R wrote: I have to accept the first one and reject the second. Since excel stores both these values in integer format, I am not able to differentiate them. Simple - fetch the cell style that applies to the cell, get the formatting string that it uses, and see if th

Validating the excel date for MM/dd/yyyy format

2014-04-25 Thread Renjith R
Hi, I am using Apache POI to read Excel file(.xlsx) and validate its contents. We are having a date field in excel whcih should be in format MM/dd/. Suppose if the date fild has two values as follows, 1) 04/