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)-1);因为星期是从周日开始的