//获得当月时间上月1号
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
Calendar cal = Calendar.getInstance();
cal.setTime(new Date());
cal.add(Calendar.MONTH, -1);
cal.set(Calendar.DAY_OF_MONTH,
cal.getActualMinimum(Calendar.DAY_OF_MONTH));
System.out.println("当月时间上月1号-->"+sdf.format(cal.getTime()));

1万+

被折叠的 条评论
为什么被折叠?



