Java SQL Date Create getLastDayofMonth(Date date1)

Here you can find the source of getLastDayofMonth(Date date1)

Description

get Last Dayof Month

License

Open Source License

Declaration

public static Date getLastDayofMonth(Date date1) 

Method Source Code


//package com.java2s;
import java.sql.Timestamp;

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

public class Main {
    public static Date getLastDayofMonth(Date date1) {
        Calendar cld = Calendar.getInstance();
        cld.setTime(date1);//from w w w . j a va 2  s.c  o  m
        cld.set(5, 1);
        return cld.getTime();
    }

    public static String getTime() {
        Timestamp time = new Timestamp(Calendar.getInstance().getTime().getTime());
        return time.toString();
    }
}

Related

  1. getDayStart(Date stamp)
  2. getLastDateOfQuarter()
  3. getLastDay(Date date)
  4. getLastDay(Date dt)
  5. getLastDay(java.util.Date dt)
  6. getLastDayOfMonth(java.sql.Date date)
  7. getLastDayOfPreviousMonth(Date date, boolean isFormatDate)
  8. getLastSundayDate()
  9. getLongDate(String strDate)