Java Month Calculate getMonthNumber()

Here you can find the source of getMonthNumber()

Description

get Month Number

License

Open Source License

Declaration

public static String getMonthNumber() 

Method Source Code

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

import java.util.*;

public class Main {
    public static String getMonthNumber() {
        Calendar calendar = new GregorianCalendar();
        int m = calendar.get(GregorianCalendar.MONTH);
        String month = new Integer(m + 1).toString();
        if (month.length() < 2)
            month = "0" + month;

        return month;
    }//w w w  .j av a 2  s .  c om
}

Related

  1. getIntMonthShift(Date Shift)
  2. getlastDateofThisMonth()
  3. getLastMonthBegin()
  4. getMonthFormat(String date)
  5. getMonthlyIntervals(Date start, Date end)
  6. getMonthsMap()
  7. getMonthsOfAge(Date birth, Date now)
  8. getMonthSpan(Date begin, Date end)
  9. getNextMonth(long date)