Java Date to Month getMonthStartDay(Date date)

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

Description

get Month Start Day

License

Open Source License

Declaration

public static Date getMonthStartDay(Date date) 

Method Source Code

//package com.java2s;

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

public class Main {
    public static Date getMonthStartDay(Date date) {
        Calendar calendar = getCalendar(date);
        calendar.set(Calendar.DAY_OF_MONTH, 1);
        return calendar.getTime();
    }/*from  w  ww . j  a v a 2 s  .c o m*/

    /**
     * @param date
     * @return Calendar
     */
    public static Calendar getCalendar(Date date) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        return calendar;
    }
}

Related

  1. getMonthOfYear(final Date date)
  2. getMonthRate(Date date, boolean moveIn)
  3. getMonths(Date date1, Date date2)
  4. getMonthStart(Date date)
  5. getMonthStart(Date date)
  6. getNextMonth(Date baseDate, int Month)
  7. getNextMonth(Date time)
  8. getNextMonth(long date)
  9. getNextMonthDate(Date appointDate)