As earlier mentioned, cell.putValue(date) or cell.setValue(date) is not working as expected. Please look into it.
Let me know if you need more information.
Scenario: One of the column in data is of type date (format – ‘yyyy-mm-dd’). I am using cell.putValue(new Datetime(dateObject)) method to save it in excel. Here dateObject is java.util.date object with date formatter of pattern – ‘yyyy-mm-dd’ as I wanted the same in excel as well.
Expectations – value should be stored in excel table maintaining the datatype and pattern.
Existing behaviour – value is getting stored as general datatype, some random number is getting stored. Attaching the excel for your reference, column- ‘OrderDate’ is the one I am referring here which is having date as datatype.
Am I missing anything or can you please suggest me another way to achieve it?
Thanks, &
Regards