import java.util.*;
import java.text.*;
public class ProgrammingShift {
public static void main(String[] args) {
//Get
current date time
Date currentDate = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy
HH:mm:ss");
System.out.println("Current Date:
"+sdf.format(currentDate));
//Convert
String to Date
try{
String strDate = "10/20/1980";
SimpleDateFormat sdfBirthday = new SimpleDateFormat("MM/dd/yyyy");
Date birthday = sdfBirthday.parse(strDate);
SimpleDateFormat sdfBirthday1 = new SimpleDateFormat("yyyy/MM/dd");
System.out.println("Birthday: "+sdfBirthday1.format(birthday));
}
catch(Exception e)
{
System.out.println("e.getMessage()");
}
}
}