Bookmark Topic Watch Topic
  • New Topic

getting custom format for date in excel from resultset  RSS feed

 
narayana Ega
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Report post to moderator
CreationHelper createHelper = workbook.getCreationHelper();
CellStyle cellStyle = workbook.createCellStyle();
cellStyle.setDataFormat(createHelper.createDataFormat().getFormat("d/m/yy"));

cell.setCellValue(res.getString("mdate"));
cell.setCellStyle(cellStyle);

Eventhough i set like this its coming like 01-01-1970 05:30:00.....what i have to do reply me......
 
Campbell Ritchie
Marshal
Posts: 56227
171
  • Mark post as helpful
  • send pies
  • Report post to moderator
This seems to be a duplicate of this post, so I shall lock this thread.
 
It is sorta covered in the JavaRanch Style Guide.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!