• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 169
  • Last Modified:

Not able to display the date formate while passing through java

I am passing date string to excel. my date string formate is  (MMM dd,yyy) i.e NOV 11, 2009
i want to display the date  in excel in the same formate as it is being sent. But in the excel i am getting date in different formate  i.e 11-Nov-09.
i am using response.setContentType("application/vnd.ms-excel"); to convert the data from java to excel.
Can anybody help me
0
kbb1
Asked:
kbb1
1 Solution
 
leonstrykerCommented:
I would say pass it as either text or run some code to apply the format after the data is transferred.

Leon
0
 
Gurvinder Pal SinghCommented:
@kbb1: which package are you using for creating the excel sheet through Java.
If it is Apache POI then you can set a specific date format by using
cell.getCellStyle().setDataFormat();

Please go through this documentation
http://poi.apache.org/spreadsheet/converting.html
http://poi.apache.org/spreadsheet/how-to.html
http://onjava.com/pub/a/onjava/2003/04/16/poi_excel.html
http://www.javaworld.com/javaworld/jw-03-2004/jw-0322-poi.html
http://rgagnon.com/javadetails/java-0516.html

Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now