In order to make the format adaptable to the operating system's locale, you have to use the built-in number formats. Please review the detailed article on setting date & number formats using Aspose.Cells for Java APIs and check the built-in number formats from 14 to 17 for date literals. See the sample code below:
Workbook book = new Workbook();
Worksheet sheet = book.getWorksheets().get(0);
Cells cells = sheet.getCells();
Style style = book.createStyle();
//style.setCustom("m/d/yyyy");
style.setNumber(14);
Cell cell = cells.get("A1");
cell.setStyle(style);
String date = "2/23/2015";
DateTime myDate = new DateTime(new Date(date));
cell.setValue(myDate);
book.save("output.xlsx");
I am working as Support developer/ Evangelist at Aspose.