Date date = new Date();
System.out.println(date.toString());
System.out.println(date.toLocaleString());
Date date1 = new Date(date.getTime()-(1000*60*60*24*5));
System.out.println(date1.toLocaleString());
System.out.println(date.before(date1));
System.out.println(date.after(date1));
System.out.println(date.compareTo(date1));
System.out.println(date.equals(date));
Calendar calendar=Calendar.getInstance();
System.out.println(calendar.getTime().toLocaleString());
System.out.println(calendar.getTime().getClass());
System.out.println(calendar.get(Calendar.YEAR));
System.out.println(calendar.get(Calendar.MONTH)+1);
System.out.println(calendar.get(Calendar.DAY_OF_MONTH));
System.out.println(calendar.get(Calendar.HOUR_OF_DAY));
System.out.println(calendar.get(Calendar.MINUTE));
System.out.println(calendar.get(Calendar.SECOND));
calendar.add(Calendar.MONTH,11);
calendar.set(Calendar.DAY_OF_MONTH,31);
System.out.println(calendar.getTime().toLocaleString());
calendar.add(Calendar.MONTH,2);
System.out.println(calendar.getTime().toLocaleString());
System.out.println(calendar.getActualMaximum(Calendar.MONTH));
System.out.println(calendar.getActualMinimum(Calendar.MONTH));
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
Date date3= new Date(100,8,23,12,23,23);
String format = simpleDateFormat.format(date3);
System.out.println(format);
Date date5 = simpleDateFormat.parse("2019/12/12 23:12:22");
System.out.println(date5.toLocaleString());