public static void main(String[] args) throws ParseException {
SimpleDateFormat fm1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
SimpleDateFormat fm2 = new SimpleDateFormat("yyyy-MM-dd");
Date d1 = new Date();
System.out.println(fm1.format(d1));
Date d2 = fm2.parse("1989-12-04");
System.out.println(fm1.format(d2));