Java Month of Year getLastMonthDate()

Here you can find the source of getLastMonthDate()

Description

get Last Month Date

License

Open Source License

Declaration

private static String getLastMonthDate() 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.text.DateFormat;
import java.text.SimpleDateFormat;

import java.util.Calendar;

public class Main {
    private static String getLastMonthDate() {
        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
        Calendar c = Calendar.getInstance();
        c.add(Calendar.MONTH, -1);
        return dateFormat.format(c.getTime());
    }//from w  w w  .  j  a v  a2 s. co m
}

Related

  1. getLastMonth()
  2. getLastMonth()
  3. getLastMonth()
  4. getLastMonthAndCycle()
  5. getLastMonthdate()
  6. getLastMonthDate(int date)
  7. getLastMonthOfQuater(Date date)
  8. getLastMonthOfYear()
  9. getMaxDayOfMonth(int year, int month)