Java Month of Year getEndOfMonth(String year, String month)

Here you can find the source of getEndOfMonth(String year, String month)

Description

get End Of Month

License

Open Source License

Declaration

public static String getEndOfMonth(String year, String month) 

Method Source Code

//package com.java2s;
/**//w ww.  j av  a 2  s . co  m
 *
 * Copyright (c) 2012 ChinaSoft International Co., Ltd.
 * All rights reserved.
 * This software is the confidential and proprietary information of
 * ChinaSoft International. ("Confidential Information").
 * You shall not disclose such Confidential Information and shall use it
 * only in accordance with the terms of the license agreement you entered
 * into with ChinaSoft International.
 *
 * ?????????
 * 2012-5-21 ??
 */

import java.util.Calendar;

public class Main {

    public static String getEndOfMonth(String year, String month) {
        Calendar cal = Calendar.getInstance();
        cal.set(Calendar.YEAR, Integer.parseInt(year));
        cal.set(Calendar.MONTH, Integer.parseInt(month) - 1);
        return cal.getActualMaximum(Calendar.DAY_OF_MONTH) + "";
    }
}

Related

  1. get_NextSunday_YearMonthDay_integerArray()
  2. getActualMonthBefore(int year, int month, int i)
  3. getCalforMonth(String month, String year)
  4. getDaysByYearMonth(int year, int month)
  5. getDefaultHolidays(int year, int month)
  6. getFirstMonthOfThisYear()
  7. getFirstTimeOfDay(int year, int month, int day)
  8. getLastCompletedMonthAndYear()
  9. getLastMonth()