Java Month Day getLastMonthLastDay()

Here you can find the source of getLastMonthLastDay()

Description

get Last Month Last Day

License

Open Source License

Declaration

public static String getLastMonthLastDay() 

Method Source Code


//package com.java2s;

import java.text.SimpleDateFormat;
import java.util.Calendar;

public class Main {

    public static String getLastMonthLastDay() {

        Calendar cal = Calendar.getInstance();
        cal.setTime(cal.getTime());/*from   w  w  w  .  ja v  a  2s  .c o  m*/
        cal.add(Calendar.MONTH, -1);

        SimpleDateFormat daytime = new SimpleDateFormat("yyyyMMdd");
        cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
        return daytime.format(cal.getTime());
    }
}

Related

  1. getFirstDayStringOfMonth(Date date)
  2. getFirstDayStrOfMonth(Date date)
  3. getLastMonthDay()
  4. getLastMonthLastDate()
  5. getLastMonthLastDay()
  6. getLastMothStart()
  7. GetLastWorkDayofMonth(String strDateStart)
  8. getMonthDay(int year, int month)
  9. getMonthEndDay(String time)