Java Day of Month getLastdayofMonth()

Here you can find the source of getLastdayofMonth()

Description

get Lastdayof Month

License

Open Source License

Declaration


public static String getLastdayofMonth() 

Method Source Code


//package com.java2s;

import java.text.SimpleDateFormat;

import java.util.Calendar;

public class Main {
    /**//from  w  w w . j  a v  a 2 s. co  m
     * @Title: getLastdayofMonth
     * @Description: TODO
     * @author alterhu2020@gmail.com
     * @param @return
     * @return String return type
     * @throws
     */

    public static String getLastdayofMonth() {
        Calendar c = Calendar.getInstance();
        int totalday = c.getActualMaximum(Calendar.DAY_OF_MONTH);
        c.set(Calendar.DAY_OF_MONTH, totalday);
        System.out.println(c.getTime());
        return new SimpleDateFormat("yyyy-MM-dd").format(c.getTime());
    }
}

Related

  1. getLastDayByMonthWeek(int year, int month, int week)
  2. getLastDayInMonth(int year, int month)
  3. getLastDayOfCurMonth()
  4. getLastDayOfLastMonth()
  5. getLastDayOfMonth()
  6. getlastDayOfMonth()
  7. getLastDayOfMonth()
  8. getLastDayOfMonth(Calendar c)
  9. getLastDayOfMonth(Date currDate)