Java Day in Month getDayByOfSomeMonth(String curday, int month)

Here you can find the source of getDayByOfSomeMonth(String curday, int month)

Description

get Day By Of Some Month

License

Open Source License

Declaration

public static String getDayByOfSomeMonth(String curday, int month) throws ParseException 

Method Source Code


//package com.java2s;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class Main {
    public static String getDayByOfSomeMonth(String curday, int month) throws ParseException {
        SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
        Date mydate = formatter.parse(curday);
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(mydate);//from  ww  w.  j av a2s  .c  om
        calendar.add(Calendar.MONTH, month);
        return formatter.format(calendar.getTime());
    }
}

Related

  1. firstDayOfMonth(int commonMonthIndx, int iyear)
  2. firstDayOfMonth(int year, int month, String dateFormat)
  3. firstDayOfNextMonth(String dateFormat)
  4. getCountDayForMonth(int year, int month)
  5. GetDay(int month)
  6. getDayMonth(String dayofmonth)
  7. getDayOfMonth(Date d)
  8. getDayOfMonth(Date date)
  9. getDayOfMonth(Date p_date)