| | |
| | | } |
| | | |
| | | public static Date getLastDate() throws ParseException { |
| | | return getDateFromString("3000-01-01", DATE_FORMATE_STRING_B); |
| | | return getDateFromString("2037-12-01", DATE_FORMATE_STRING_B); |
| | | } |
| | | |
| | | /** |
| | |
| | | int maxDate = a.get(Calendar.DATE); |
| | | return maxDate; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 在给定的日期加上或减去指定月份后的日期 |
| | | * |
| | | * @param sourceDate 原始时间 |
| | | * @param month 要调整的月份,向前为负数,向后为正数 |
| | | * @return |
| | | */ |
| | | public static Date stepMonth(Date sourceDate, int month) { |
| | | Calendar c = Calendar.getInstance(); |
| | | c.setTime(sourceDate); |
| | | c.add(Calendar.MONTH, month); |
| | | |
| | | return c.getTime(); |
| | | } |
| | | } |