Java Calendar Month getMonthStart(Calendar c)

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

Description

get Month Start

License

Open Source License

Declaration

public static Date getMonthStart(Calendar c) 

Method Source Code


//package com.java2s;
/* Copyright c 2005-2012.
 * Licensed under GNU  LESSER General Public License, Version 3.
 * http://www.gnu.org/licenses/*from   w  ww .  ja va 2 s.c o m*/
 */

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

public class Main {

    public static Date getMonthStart(Calendar c) {
        c.set(Calendar.DAY_OF_MONTH, 1);
        c.set(Calendar.HOUR_OF_DAY, 0);
        c.set(Calendar.MINUTE, 0);
        c.set(Calendar.SECOND, 0);
        c.set(Calendar.MILLISECOND, 0);
        return c.getTime();
    }
}

Related

  1. getMonth(Calendar cal)
  2. getMonth(Calendar calendar)
  3. getMonthBegin(Calendar c)
  4. getMonthBegin(Calendar calendar)
  5. getMonthName(Calendar cal)
  6. getMonthStart(Calendar cal)
  7. getMonthStr(Calendar cal)
  8. getNextMonth(Calendar calendar, int month)
  9. getNumDaysInMonth(GregorianCalendar aCalendar)