import java.util.Date;
import java.text.SimpleDateFormat;
public class test{
public static void main(String args[]){
String dateStr = "26/08/2010";
SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
try{
Date date = formatter.parse(dateStr);
System.out.println("Date is : " + formatter.format(date));
}
catch (java.text.ParseException e){
e.printStackTrace();
}
}
}
No comments:
Post a Comment