Date now = new Date(); 当前时间就是now,你试着打印一下就出来了,如果对日期时间格式有要求,就SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式,不就OK了
Calendar calendar = Calendar.getInstance();
SimpleDateFormat df = new SimpleDateFormat("yyyy-M-d");
String s = df.format(calendar.getTime());
System.out.println(s);
System.out.println(calendar.get(Calendar.DAY_OF_WEEK));