Java Date to Month monthBegin(final Date date)

Here you can find the source of monthBegin(final Date date)

Description

month Begin

License

Apache License

Declaration

public static Date monthBegin(final Date date) 

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 monthBegin(final Date date) {
        Calendar c = Calendar.getInstance();
        c.setTime(date);/*from w  w  w .  j  a v a2 s .  co m*/
        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. getNextMonthPreviousDay(Date date, int month_num)
  2. getNextMonthsByStartDate(Date date, int month)
  3. month(Date date)
  4. month(Date inDate, TimeZone timeZone)
  5. month(final Date date)
  6. monthOf(Date date)