HSSF - How to keep Date data type when exporting to excel using HSSF
I am using POI-HSSF to export some data to excel. Requirement is I need to keep data type of each column. I can keep data type for string and numeric values but not the date. I studied in POI documentation that it supports only 3 basic data types string, numeric and boolean.
Can anyone please tell me how can I keep the 'Date' data type when exporting to excel?
You can look up DateUtil offered by poi.
The way you check for String, numeric and boolean data types, you can use isCellDateFormatted the same was and get the date cell value (getDateCellValue) - which you can keep, reformat or use them in your customized way.