Java Day End getMonthEndDate(int year, int month)

Here you can find the source of getMonthEndDate(int year, int month)

Description

get Month End Date

License

Apache License

Declaration

public static Date getMonthEndDate(int year, int month) 

Method Source Code

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

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

public class Main {

    public static Date getMonthEndDate(int year, int month) {
        Calendar c = Calendar.getInstance();
        c.set(Calendar.YEAR, year);
        c.set(Calendar.MONTH, month);
        c.set(Calendar.DAY_OF_MONTH, 0);
        c.set(Calendar.HOUR_OF_DAY, 23);
        c.set(Calendar.MINUTE, 59);
        c.set(Calendar.SECOND, 59);
        return c.getTime();
    }/*from w w w.j  ava  2s  . c om*/

    public static long getTime() {

        return (new java.util.Date()).getTime();
    }
}

Related

  1. getMonthBetween(Date startDate, Date endDate)
  2. getMonthCha(Date start, Date end)
  3. getMonthCount(Date startDate, Date endDate)
  4. getMonthEnd(Date date)
  5. getMonthEndDate(Date date)
  6. getMonthEndDate(Long day)
  7. getMonthFirstDays(Date startDate, Date endDate)
  8. getMonths(Date end, Date start)
  9. getMonthsBetweenBeginDateAndEndDate(Date beginDate, Date endDate)