on 06-08-2010 1:00 PM
Hi Friends,
I have one doubt on WDJ.
I have done one Application that application having one functionality that is Download data in to Excel. After download data into excel we can change the DATE cell and again upload Excel Data.
Here what I am getting problem is download data into SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy"); this date forame. And again upload data into Same date formate
But it is not uploaded
When I download data into SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); this date format that time it will upload successfully.
This is for Dowload data into Excel
if(StockEle.getConf_Shp_Date()==null)
{
ExcelEle.setConf_Shp_Date("null");
}
else
{
SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy");
Date ConfShpDate = wdContext.nodePoDetails_OutTab().getPoDetails_OutTabElementAt(i).getConf_Shp_Date();
String ConfShpDate1 = sdf.format(ConfShpDate); // will give dd-MM-yyyy
ExcelEle.setConf_Shp_Date(ConfShpDate1);
}
Here ExcelEle.setConf_Shp_Date data type is String
This is for Upload data
try
{
SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy");
//Date dt = sdf.parse(ele.getConf_Shp_Date());
// java.util.Date Date dt = sdf.parse(ele.getConf_Shp_Date());
java.util.Date dt = sdf.parse(ele.getConf_Shp_Date());
java.sql.Date sqlDate = new java.sql.Date(dt.getTime());
eleout.setEindt(sqlDate);
}
catch(Exception e)
{
e.printStackTrace();
}
eleout.setEindt data type is Date.
How to Solve this issue I want upload this type of date (dd.MM.yyyy).
Regards
Vijay Kalluri
Hi
Try to format it before sending it back , try using these code
// Create Date object. Date date = new Date();
//Specify the desired date format
String DATE_FORMAT = "MM/dd/yyyy";
//Create object of SimpleDateFormat and pass the desired date format.
SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT);
/* Use format method of SimpleDateFormat class to format the date. */
System.out.println("Today is " + sdf.format(date) );
Best Regards
Satish Kumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.