Hi Team,
I am getting different formats for Date field in cell.getStringValue() while fetching same formatted data from xls and xlsx.
Let’s say my Excel contains mm/dd/yyyy
Xls returns -> mm-dd-yyyy
Xlsx return -> mm/dd/yyyy
Anyway within my code I am trying to save workbook after users uploads so I cam across such below options.
wb.save(“abc.xls”, new XlsSaveOptions(SaveFormat.XLSX));
wb.save(“abc.xls”, SaveFormat.XLSX);
Also please note with this also file remains abc.xls but gives correct output same as Excel.
Now Xls returns -> mm/dd/yyyy which is expected.
Please note I don’t want to change the extension xls should remain xls and xlsx should remain xlsx and below code does that
wb.save(“abc.xls”, new XlsSaveOptions(SaveFormat.XLSX));
wb.save(“abc.xls”, SaveFormat.XLSX);
C_Test.zip (19.7 KB)
Just wanted to check that what is difference between above two ? What is best to use? Will there be any issue while saving format as xlsx?