Android Date Get getMonth(Date date)

Here you can find the source of getMonth(Date date)

Description

get Month

Declaration

public static int getMonth(Date date) 

Method Source Code

//package com.java2s;

import java.util.Calendar;
import java.util.Date;

public class Main {
    public static int getMonth(Date date) {
        if (null == date) {
            throw new IllegalArgumentException("The date is null");
        }/* w  w w  .  j  a  va2 s .com*/

        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);

        return calendar.get(Calendar.MONTH);
    }
}

Related

  1. getDayOfWeek(String date)
  2. getDayOfWeek(String year, String month, String day)
  3. getDayofWeekInMonth(String year, String month, String weekOfMonth, String dayOfWeek)
  4. getDaysOfCurMonth()
  5. getDaysOfCurMonth(final String time)
  6. getTomorrowAtEight()
  7. getWeekOfDate(Date dt)
  8. getYear(Date date)
  9. getDateObj()