I am currently reading a CSV file. I have to extract the dates from it and add them to excel file in dd-MM-yy
format. I am faced with two problems.
- I am using
String.split(delim)
where,delim="[,]"
. I am getting the date inyyyy-MM-dd
format. - I am not able to convert the string into a date format and then add them to excel file. I tried using
DateFormat
but error saysDateformat is abstract
.
Here is the code
dtformat=new SimpleDateFormat("dd-MM-yy");
datenow=dtformat.parse(stringDate);//datenow is what i want to add to add.
datecell=new DateTime(tokenNumber, lineNumber, datenow);
sheet.addCell(datecell);
When I open the excel file, I get wild values.
Please help.Thanks in advance
Google is your friend.
To parse date:
To write date: