Date dt = new Date();
SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd");//格式化
System.out.println(f.format(dt)); //用SimpleDateFormat格式来格式化当前时间
Calendar calendar = Calendar.getInstance();
//每月第几周
System.out.println(calendar.get(Calendar.WEEK_OF_MONTH));
//每周第几天,1代表周日,2代表周一
System.out.println(calendar.get(Calendar.DAY_OF_WEEK));
//每月第几天
System.out.println(calendar.get(Calendar.DAY_OF_MONTH));