|
|
@ -962,27 +962,6 @@ public class DateUtils { |
|
|
|
return new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD).format(time); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取本月开始日期 |
|
|
|
* @return String |
|
|
|
* **/ |
|
|
|
public static String getMonthStart(){ |
|
|
|
Calendar cal=Calendar.getInstance(); |
|
|
|
cal.add(Calendar.MONTH, 0); |
|
|
|
cal.set(Calendar.DAY_OF_MONTH, 1); |
|
|
|
Date time=cal.getTime(); |
|
|
|
return new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMM).format(time); |
|
|
|
} |
|
|
|
/** |
|
|
|
* 获取本月最后一天 |
|
|
|
* @return String |
|
|
|
* **/ |
|
|
|
public static String getMonthEnd(){ |
|
|
|
Calendar cal=Calendar.getInstance(); |
|
|
|
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH)); |
|
|
|
Date time=cal.getTime(); |
|
|
|
return new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMM).format(time); |
|
|
|
} |
|
|
|
|
|
|
|
public static void main(String[] args) throws ParseException { |
|
|
|
String first = DateUtils.getFirstOfWeek("20210801"); |
|
|
|