Java Calendar Month getMonthStr(Calendar cal)

Here you can find the source of getMonthStr(Calendar cal)

Description

get Month Str

License

Open Source License

Declaration

public static String getMonthStr(Calendar cal) 

Method Source Code

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

import java.util.Calendar;

public class Main {
    public static String getMonthStr(Calendar cal) {
        int month = cal.get(Calendar.MONTH) + 1;
        return month > 9 ? "" + month : "0" + month;
    }/*from   w w  w. j  av a 2 s  .co  m*/
}

Related

  1. getMonthBegin(Calendar c)
  2. getMonthBegin(Calendar calendar)
  3. getMonthName(Calendar cal)
  4. getMonthStart(Calendar c)
  5. getMonthStart(Calendar cal)
  6. getNextMonth(Calendar calendar, int month)
  7. getNumDaysInMonth(GregorianCalendar aCalendar)
  8. getStartOfMonth(Date day, Calendar cal)
  9. incrementMonth(Calendar cal)