Java Date to Month getMonthLastDate(Date date)

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

Description

get Month Last Date

License

Apache License

Declaration

public static Date getMonthLastDate(Date date) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Calendar;

import java.util.Date;

public class Main {
    public final static Calendar cal = Calendar.getInstance();

    public static Date getMonthLastDate(Date date) {
        cal.setTime(date);/*  www. j  av a2 s  .c om*/
        cal.add(Calendar.MONTH, 1);
        cal.add(Calendar.DAY_OF_MONTH, -1);
        Date tmpdate1 = new Date(cal.getTime().getTime());
        return tmpdate1;

    }
}

Related

  1. getMonthByOffset(Date date, int offset)
  2. getMonthDays(String date)
  3. getMonthFirstDay(Date date)
  4. getMonthFromDate(Date date)
  5. getMonthInterval(Date _one, Date _two)
  6. getMonthLastDay(Date date)
  7. getMonthlyKey(Date d)
  8. getMonthName(Date date)
  9. getMonthOfCurrentTime(Date date)