0

I have created a file named tablenew.xls which has date with following code:

         DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
          Date date = (Date)formatter.parse(st[length]); 
          datecell=new DateTime(tokenNumber,lineNumber,date);
           sheet.addCell(datecell);

I am getting the output in my file as "04-03-11" which is "dd-MM-yy". However when this same date is written to another file named tabletemp.xls with the same code , i get the output as something like -689881.5. My dilemma is that the my program however, seems to understand this negative value as a date. Should i modify my code? if so, then what should i do? thanks in advance

CyprUS
  • 4,159
  • 9
  • 48
  • 93

1 Answers1

0

Problem is solved. Thanks anyways. As always, the date "04-03-11" was displayed as "dd-MM-yy" , was however treated by excel as "MM/dd/yy" . Jexcel should look into this problem. Their date parsing is a big pain.

CyprUS
  • 4,159
  • 9
  • 48
  • 93