hai guys i have a problem in changing the date format from , this is as follows
i will be getting a
string "050622" which is taken as date format "yyMMdd" now thw thing is that we have to change the String to Date and the format of Date being "dd-MMM-yy".
i have tried with the following code but was stuck up at the point
public static void main(String[] args)
{
try
{
String srcValue = "050622";
ParsePosition pos = new ParsePosition(0);
SimpleDateFormat SDF=new SimpleDateFormat("yyMMdd");
Date dt = SDF.parse(srcValue,pos);
SDF.applyPattern("dd-MMM-yy");
srcValue = SDF.format(dt);
System.out.println(srcValue);
}
catch(Exception e)
{
System.out.println(e);
}
}