Android Month Date Get getInterval(String beginMonth, String endMonth)

Here you can find the source of getInterval(String beginMonth, String endMonth)

Description

get Interval

Declaration

public static int getInterval(String beginMonth, String endMonth) 

Method Source Code

//package com.java2s;

public class Main {
    public static int getInterval(String beginMonth, String endMonth) {
        int intBeginYear = Integer.parseInt(beginMonth.substring(0, 4));
        int intBeginMonth = Integer.parseInt(beginMonth
                .substring(beginMonth.indexOf("-") + 1));
        int intEndYear = Integer.parseInt(endMonth.substring(0, 4));
        int intEndMonth = Integer.parseInt(endMonth.substring(endMonth
                .indexOf("-") + 1));

        return ((intEndYear - intBeginYear) * 12)
                + (intEndMonth - intBeginMonth) + 1;
    }//from  w w  w.  jav  a 2s . com
}

Related

  1. maxMonthDate(Date date)
  2. getMonthStartDate(Date date)
  3. getMonthEndDate(Date date)
  4. getCurrentMonth()
  5. monthNumber()
  6. monthOffset(Date date, int offset)
  7. getMonth()
  8. getCurrentMonth()
  9. getStringMonth(Date date)