Java Month Get getMonth()

Here you can find the source of getMonth()

Description

get Month

License

LGPL

Declaration

public static int getMonth() 

Method Source Code

//package com.java2s;
//License from project: LGPL 

import java.util.*;

public class Main {
    /**/*from  ww  w .  j  ava  2 s. co m*/
     * MONTH=2 *
     */
    public static final int MONTH = Calendar.MONTH;

    public static int getMonth() {
        Calendar calendar = Calendar.getInstance();
        return calendar.get(Calendar.MONTH) + 1;
    }

    public static int getMonth(final Date date) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        return calendar.get(Calendar.MONTH) + 1;
    }
}

Related

  1. getIntervalMonths(String startDate, String endDate)
  2. getIntevalMonth(String strDate1, String strDate2)
  3. getMonth()
  4. getMonth()
  5. getMonth()
  6. getMonth()
  7. getMonth()
  8. getMonth()
  9. getMonth()