Java Calendar Month getFirstDateOfMonth(Calendar calendar)

Here you can find the source of getFirstDateOfMonth(Calendar calendar)

Description

get First Date Of Month

License

Open Source License

Declaration

public static Date getFirstDateOfMonth(Calendar calendar) 

Method Source Code

//package com.java2s;

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

public class Main {

    public static Date getFirstDateOfMonth(Date date) {
        Calendar c = Calendar.getInstance();
        c.setTime(date);//from   w w w .  jav a 2s. com
        return getFirstDateOfMonth(c);
    }

    public static Date getFirstDateOfMonth(Calendar calendar) {
        calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMinimum(Calendar.DAY_OF_MONTH));
        return calendar.getTime();
    }
}

Related

  1. endOfMonth(Calendar calendar)
  2. floorDayOfMonth(Calendar cal)
  3. getCalDayofMonth(Date calendarDay)
  4. getDayOfMonthPostfix(Calendar cal)
  5. getDaysInMonth(Calendar cal)
  6. getFirstDayOfMonth(Calendar c)
  7. getFirstDayOfMonth(Calendar cal)
  8. getFirstDayOfMonth(final Calendar calendar, final Date date)
  9. getLastDateOfMonth(Calendar calendar)