Java:月の加算を行なう(DateUtils)

commons のorg.apache.commons.lang.time.DateUtilsを使って月の加算をおこなう。

 /**
  * 月の加算を行なう
  *
  * @param d
  * @param amountMonth
  * @return Date
  */
 public static Date addMonth(Date d, int amountMonth) {
  return DateUtils.addMonths(d, amountMonth);
 }

 

コメントを残す

メールアドレスが公開されることはありません。