//1、创建一个Date的对象,代表系统当前的时间信息
Date d=new Date();
System.out.println(d);
//2、拿到时间毫秒值
long time=d.getTime();
//3、把时间毫秒值转换成日期对象:2s后时间是多少
time+=2*1000;
Date d2=new Date(time);
//4、直接把日期对象的时间通过setTime方法进行修改
Date d3=new Date();
d3.setTime(time);
传统时间:simpleDateFormate
//目标:掌握SimpleDateFormat的使用
//1.准备一些时间
Date d=new Date();
long time=d.getTime();
//2.格式化日期对象和时间毫秒值
SimpleDateFormat sdf=new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss EEE a");
String rs=sdf.format(d);