Java Day of Month getLastDayOfMonth(Date date)

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

Description

get Last Day Of Month

License

Open Source License

Declaration

public static Date getLastDayOfMonth(Date date) 

Method Source Code

//package com.java2s;

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

public class Main {

    public static Date getLastDayOfMonth(Date date) {
        Calendar c = Calendar.getInstance();
        c.setTime(date);//from ww  w .  j av  a 2 s  .co  m
        c.set(Calendar.DATE, 1);
        c.add(Calendar.MONTH, 1);
        c.add(Calendar.DATE, -1);
        date = c.getTime();
        return date;
    }
}

Related

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