| | |
| | | * @return String |
| | | * @throws Exception |
| | | */ |
| | | public static String getPlusTime(Date date) throws Exception { |
| | | public static String getPlusTime(Date date) { |
| | | if (date == null) |
| | | return null; |
| | | try { |
| | |
| | | public static String getFirstDayOfThisMonth() { |
| | | try { |
| | | return getNowShortDate().substring(0, 6) + "01"; |
| | | } catch (Exception e) { |
| | | return ""; |
| | | } |
| | | } |
| | | public static String getFirstDayCurrentMonth() { |
| | | try { |
| | | return getDateLong(new Date()).substring(0, 7) + "-01"; |
| | | } catch (Exception e) { |
| | | return ""; |
| | | } |
| | |
| | | calendar.add(Calendar.DATE, days);// |
| | | return calendar.getTime(); |
| | | } |
| | | public static Date addMonthToDate(Date date, int month) { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(date); |
| | | calendar.add(Calendar.MONTH, month);// |
| | | return calendar.getTime(); |
| | | } |
| | | |
| | | public static String afterDateToStr(Integer days){ |
| | | Date date = new Date(); |