标签:blog java 2014 re c ar file log
Calendar instance = Calendar.getInstance(); System.out.println(instance.getTime()); instance.add(Calendar.MONTH, 1);//月份+1 instance.set(Calendar.DAY_OF_MONTH, 1);//天设为一个月的第一天 System.out.println(instance.getTime()); instance.add(Calendar.DAY_OF_MONTH, -1);//本月最后一天 System.out.println(instance.getTime()); instance.add(Calendar.DAY_OF_MONTH, 1 - instance.get(Calendar.DAY_OF_WEEK));//根据月末最后一天是星期几,向前偏移至最近的周日 System.out.println(instance.getTime());
java实现一个月的最后一个星期天,布布扣,bubuko.com
标签:blog java 2014 re c ar file log
原文地址:http://blog.csdn.net/dingnate/article/details/38091137