//获取当前星期几 Calendar calendar; calendar = Calendar.getInstance(); System.out.println(calendar); System.out.println("当前月份:"+calendar.DAY_OF_MONTH); String week; week = calendar.get(calendar.DAY_OF_WEEK) - 1 + ""; if ("0".equals(week)) { week = "7"; } System.out.println("当前星期:"+week);