I want to convert the
string which is in format (month day year )eg 16.05.99 to (year month day ) 19990516T120000.000Z format .For that i wrote folowing piece of code.Just it is taking lot of time about 300 milliseconds to convert each date.Is there some other way to achieve the same result faster.
public static String convertDate(String oldDate) throws Exception
{
SimpleDateFormat oldDateFormat = new SimpleDateFormat("dd.MM.yy'T'HHmmss.SSS'Z'");
oldDate = oldDate+"T120000.000Z" ;
java.util.Date dt = null;
dt = oldDateFormat.parse(oldDate);
SimpleDateFormat newDateFormat = new SimpleDateFormat("yyyyMMdd'T'HHmmss.SSS'Z'");
return newDateFormat.format(dt);
}
tahnks,
peter