//1.date日期类,获取从
Date date=new Date();
System.out.println(date);
//2.Calender 可以转换成日期类
Calendar calendar=Calendar.getInstance();
System.out.println(calendar);
System.out.println(calendar.getTime());
//3.获取当前日期
LocalDate localDate= LocalDate.now();
System.out.println(localDate);
System.out.println(localDate.getDayOfMonth());
System.out.println(localDate.getDayOfWeek());
System.out.println(LocalDate.of(2020,10,8));
System.out.println(LocalDate.parse("2020-09-20"));
//4.localdatetime localtime
System.out.println("-----------------------");
LocalDateTime dateTime=LocalDateTime.now();
System.out.println(dateTime);
System.out.println("-------------------------------");
//5.simpledateformat
SimpleDateFormat format0 = new SimpleDateFormat("yyyy-MM-dd");
// String time = format0.format(ss.getTime());//这个就是把时间戳经过处理得到期望格式的时间
System.out.println(format0.format(new Date()));//格式化成字符串
System.out.println(format0.parse("2020-9-20"));
System.out.println(format0.parse("2020-10-20").getClass());//得到的是date类型