Android Month Date Get monthNumber(Date date)

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

Description

month Number

License

Open Source License

Declaration

public static int monthNumber(Date date) 

Method Source Code

//package com.java2s;

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

public class Main {
    public static int monthNumber(Date date) {
        Calendar calendar = calendarDate(date);
        return calendar.get(Calendar.MONTH);
    }//from   w w  w .j  ava 2s  .  co m

    public static int monthNumber() {
        return monthNumber(new Date());
    }

    public static Calendar calendarDate(Date date) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        return calendar;
    }
}

Related

  1. getCurrentMonth(Date date)
  2. maxMonthDate(Date date)
  3. getMonthStartDate(Date date)
  4. getMonthEndDate(Date date)
  5. getCurrentMonth()