Java Month Day getFirstDayOfLastMonth()

Here you can find the source of getFirstDayOfLastMonth()

Description

get First Day Of Last Month

License

Open Source License

Declaration

public static String getFirstDayOfLastMonth() 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;

import java.util.Calendar;
import java.util.Date;

public class Main {

    public static String getFirstDayOfLastMonth() {
        SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
        Calendar cal = Calendar.getInstance();
        cal.setTime(new Date());
        cal.add(Calendar.MONTH, -1);
        cal.set(Calendar.DAY_OF_MONTH, 1);
        return format.format(cal.getTime());
    }/* www  .  ja  v a  2  s.  c o m*/
}

Related

  1. getFirstDateOfCurMonth()
  2. getFirstDateOfMonth(Date theDate)
  3. getFirstday_Month(Date date, int months)
  4. getFirstDayOfCurMonth()
  5. getFirstDayOfCurrentMonth()
  6. getfirstDayOfMonth()
  7. getFirstDayOfMonth(Calendar c)
  8. getFirstDayOfMonth(Date date)
  9. getFirstDayOfMonth(Date date)