Excel converted to PDF have different date format (JAVA)

Hi, I have a need to convert excel files to pdf (content isn’t known and may be user inputted but some may have date values). The format of the date seems to be different from the source to the pdf result.

I’ve read that it has something to do with the locale? However, please see below code snippet and it doesn’t seem to be working. Can help advise on this issue please? Thanks!

Aspose version:
cells: 23.10
pdf: 23.10

Sample Code:
Workbook workbook = new Workbook(sourceFilePath);
// workbook.getSettings().setLocale(null);
workbook.getSettings().setLocale(Locale.getDefault());
workbook.getSettings().setRegion(CountryCode.DEFAULT);

Worksheet worksheet = workbook.getWorksheets().get(0);
worksheet.autoFitRows(true);

PdfSaveOptions pdfOptions = new PdfSaveOptions();
pdfOptions.setExportDocumentStructure(true);
workbook.save(finalSourcePath, pdfOptions);

Input:
image.png (18.8 KB)

Output:
image.png (25.6 KB)

testPdfConverted.pdf (468.7 KB)

Test_DateFormat.zip (131.1 KB)

@sysnetnovahubcom
Could you show us your local region setting?

@sysnetnovahubcom,

It seems the regional settings/locale of the machine (where your code is processed) is US-English. I opened your Excel file into MS Excel manually and found it displays the same as per your output PDF by Aspose.Cells you shared above, see the screenshot for your reference. The screenshot also shows what regional or locale settings I am using on my pc.
sc_shot1.png (160.1 KB)

Moreover, you may try to specify different region by using setRegion method in code (that gives your desired display/formatting for DateTime) to get your expected PDF file.