Question: how to set date format in excel using poi?
Answer: Create a workbook object.
Create a XSSFSheet object.
Now create a CreationHelper object (This is needed to style the date object)
Now create row/cells to write the date.
Create CellStyle and apply the CreationHelper object to format the date in your formats.