Java Year Current getCurMonthDayNumber(String strYear, String strMonth)

Here you can find the source of getCurMonthDayNumber(String strYear, String strMonth)

Description

get Cur Month Day Number

License

Apache License

Declaration

public static int getCurMonthDayNumber(String strYear, String strMonth) throws NumberFormatException 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Calendar;

import java.util.Locale;

public class Main {
    public static int getCurMonthDayNumber(String strYear, String strMonth) throws NumberFormatException {
        int ret = -1;
        if ((Integer.parseInt(strMonth) > 0) && (Integer.parseInt(strMonth) <= 12)) {
            Calendar cal = Calendar.getInstance(Locale.CHINA);
            cal.clear();/*from   ww  w.j  a v  a  2  s  .  c  o m*/
            cal.set(new Integer(strYear).intValue(), new Integer(strMonth).intValue() - 1, 1);

            ret = cal.getActualMaximum(5);
        }
        return ret;
    }
}

Related

  1. currentDayForYear(long selectTime)
  2. currentYear()
  3. currentYear()
  4. currentYear()
  5. getCurrentYear()
  6. getCurrentYear()
  7. getCurrentYear()
  8. getCurrentYear()