public class TestDate { /** * @Title: main * @param args * @return: void * @author:XIA * @date:2017年6月22日 下午3:47:09 */ public static void main(String[] args) { Date bdate = new Date(); Calendar cal = Calendar.getInstance(); cal.setTime(bdate); if (cal.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY || cal.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) { System.out.println("ok"); } else System.out.println("no"); } }