Java Date to Month month(Date date)

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

Description

month

License

Open Source License

Declaration

public static int month(Date date) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

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

public class Main {

    public static int month(Date date) {
        return toCalendar(date).get(Calendar.MONTH) + 1;
    }//from w ww.j a  v a2 s.  co  m

    public static Calendar toCalendar(Date date) {
        final Calendar cal = Calendar.getInstance();
        cal.setTime(date);
        return cal;
    }
}

Related

  1. getNextMonthExtention(Date dt, Long n)
  2. getNextMonthFirstDate(Date date)
  3. getNextMonthFirstDay(Date date)
  4. getNextMonthPreviousDay(Date date, int month_num)
  5. getNextMonthsByStartDate(Date date, int month)
  6. month(Date inDate, TimeZone timeZone)
  7. month(final Date date)
  8. monthBegin(final Date date)
  9. monthOf(Date date)