Java Day of Month getLastDayOfMonth(Date date)

Here you can find the source of getLastDayOfMonth(Date date)

Description

This method is used for getting the last day of the month

License

Open Source License

Parameter

Parameter Description
date a parameter

Declaration

public static Date getLastDayOfMonth(Date date) 

Method Source Code

//package com.java2s;
/**//from w  w  w .j a  v  a 2 s.co m
 * Copyright (C) 2013 Company. All Rights Reserved. 
 * 
 * This software is the proprietary information of Company . 
 * Use is subjected to license terms. 
 *
 * @since Jul 17, 2013 11:48:25 PM
 * @author SPA
    
 *
 */

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

public class Main {
    /**
     * This method is used for getting the last day of the month
     * 
     * @param date
     * @return
     */
    public static Date getLastDayOfMonth(Date date) {
        Calendar c = Calendar.getInstance();
        c.setTime(date);
        c.set(Calendar.DATE, c.getActualMaximum(Calendar.DAY_OF_MONTH));
        return c.getTime();
    }
}

Related

  1. getLastDayOfMonth(Date date)
  2. getLastDayOfMonth(Date date)
  3. getLastDayOfMonth(Date date)
  4. getLastDayOfMonth(Date date)
  5. getLastDayOfMonth(Date date)
  6. getLastDayOfMonth(Date dt)
  7. getLastDayOfMonth(Date firstDate)
  8. getLastDayOfMonth(Date now)
  9. getLastDayOfMonth(Date sDate)