Java Date to Month getMonth(Date date)

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

Description

get Month

License

Open Source License

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) {
        return getCalendar(date).get(2);
    }/*  w w w  . jav  a 2  s .co  m*/

    public static Calendar getCalendar(Date day) {
        Calendar c = Calendar.getInstance();
        if (day != null)
            c.setTime(day);
        return c;
    }
}

Related

  1. getMonth(Date date)
  2. getMonth(Date date)
  3. getMonth(Date date)
  4. getMonth(Date date)
  5. getMonth(Date date)
  6. getMonth(Date date)
  7. getMonth(Date date)
  8. getMonth(Date dateParam)
  9. getMonth(Date... objects)