Java Month Get getMonth()

Here you can find the source of getMonth()

Description

get Month

License

Open Source License

Declaration

public static String getMonth() 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;
import java.util.Calendar;

public class Main {

    public static String getMonth() {
        Calendar c = getCurCalendar();
        return "" + (c.get(Calendar.MONTH) + 1);
    }/*from w w  w . j a v a  2  s. com*/

    public static int getMonth(long time) {
        String date = new SimpleDateFormat("yyyyMM").format(time);
        return Integer.parseInt(date);
    }

    public static Calendar getCurCalendar() {
        return Calendar.getInstance();
    }
}

Related

  1. getCurrMonthLastDay()
  2. getEndDateOfMonth(String yyyymmdd)
  3. getEngMonth()
  4. getIntervalMonths(String startDate, String endDate)
  5. getIntevalMonth(String strDate1, String strDate2)
  6. getMonth()
  7. getMonth()
  8. getMonth()
  9. getMonth()