Java Month Calculate incrementMonth(long date, int increment)

Here you can find the source of incrementMonth(long date, int increment)

Description

increment Month

License

Open Source License

Declaration

private static long incrementMonth(long date, int increment) 

Method Source Code

//package com.java2s;
/*//w  ww . j a v  a  2  s.  c  o  m
 * $Id: DateUtils.java,v 1.1 2004/08/12 00:24:33 dmouse Exp $
 *
 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */

import java.util.*;

public class Main {
    private static Calendar CALENDAR = Calendar.getInstance();

    private static long incrementMonth(long date, int increment) {
        Calendar calendar = CALENDAR;
        synchronized (calendar) {
            calendar.setTimeInMillis(date);
            calendar.add(Calendar.MONTH, increment);
            return calendar.getTimeInMillis();
        }
    }
}

Related

  1. getNextMonthExtention(Date dt, Long n)
  2. getNowMonth()
  3. getStartOfMonth(Calendar scal)
  4. getThisMonthEnd()
  5. getThisMonthStart()
  6. intToCalendarMonth(int month)
  7. isFirstOfMonth(long date)
  8. isMonthEnd(Date date)
  9. isSameMonth(final Calendar c1, final Calendar c2)