Originally posted by tuty sra:
hi jay,
you can use
SimpleDateFormat simpleDateFormat=new SimpleDateFormat("dd-MM-yyyy");
Date date=simpleDateFormat.parse("23-09-2008");
And actually, you need to convert twice. First, you need to convert the string to the Date object using the first format. Then you need to convert the Date object back to a string using the second format, so that the string may be printed.
Alternatively, you can just do a string.replaceFirst() call, and bypass the Date object altogether.
Henry