Java Calendar Month getFirstDayOfMonth(Calendar c)

Here you can find the source of getFirstDayOfMonth(Calendar c)

Description

get First Day Of Month

License

Apache License

Declaration

public static Date getFirstDayOfMonth(Calendar c) 

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 getFirstDayOfMonth(Calendar c) {
        int year = c.get(Calendar.YEAR);
        int month = c.get(Calendar.MONTH);
        int day = 1;
        c.set(year, month, day, 0, 0, 0);
        return c.getTime();
    }//from  w  ww.  ja  v a 2  s  . c  om
}

Related

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