Bom dia,
Preciso de ajuda para formatar um campo data-hora.
Atualmente ele só exibe Data, preciso alterá-lo para exibir também a hora.
Alguém pode me ajudar
publicstaticvoidmain(String[]args)throwsIOException{HSSFWorkbookwb=newHSSFWorkbook();HSSFSheetsheet=wb.createSheet("new sheet");// Create a row and put some cells in it. Rows are 0 based.HSSFRowrow=sheet.createRow((short)0);// Create a cell and put a date value in it. The first cell is not styled// as a date.HSSFCellcell=row.createCell((short)0);cell.setCellValue(newDate());// we style the second cell as a date (and time). It is important to// create a new cell style from the workbook otherwise you can end up// modifying the built in style and effecting not only this cell but other cells.HSSFCellStylecellStyle=wb.createCellStyle();cellStyle.setDataFormat(HSSFDataFormat.getBuiltinFormat("m/d/yy h:mm"));cell=row.createCell((short)1);cell.setCellValue(newDate());cell.setCellStyle(cellStyle);// Write the output to a fileFileOutputStreamfileOut=newFileOutputStream("workbook.xls");wb.write(fileOut);fileOut.close();}