Java Date to Month getMonth(Date d)

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

Description

get Month

License

Open Source License

Declaration

public static int getMonth(Date d) 

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 getMonth(Date d) {
        Calendar c = Calendar.getInstance();
        c.setTime(d);/*w  w  w . j  a  va  2s.c  o  m*/
        return c.get(Calendar.MONTH) + 1;
    }

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

Related

  1. getMontByDate(Date curDate)
  2. getMonth(Date aDate)
  3. getMonth(Date d)
  4. getMonth(Date d)
  5. getMonth(Date d)
  6. getMonth(Date date)
  7. getMonth(Date date)
  8. getMonth(Date date)
  9. getMonth(Date date)