Skip to Content
0
Aug 06, 2012 at 03:28 PM

Date conversion

20 Views

Hi,

I have scenario where i am using the below Logic to convert the date from dd-mm-yy to this format dd-MMM-yy

DateFormat df1 = new SimpleDateFormat("dd-mm-yy");
DateFormat df2 = new SimpleDateFormat("dd-MMM-yy");
String convertedDate = "";

try{
convertedDate = df2.format(df1.parse(currentDate));
}catch(Exception ex){}

return convertedDate;

but as an output i am always getting MMM as JAN...

is there anything wrong in the logic written

regards