Java Month Day getFirstDayOfMonth(Date date)

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

Description

get First Day Of Month

License

Apache License

Declaration

public static Date getFirstDayOfMonth(Date date) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.*;

public class Main {

    public static Date getFirstDayOfMonth(Date date) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);/*from   w  w  w  .  j  a  va  2 s . com*/
        calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), 1);
        return calendar.getTime();
    }
}

Related

  1. getfirstDayOfMonth()
  2. getFirstDayOfMonth(Calendar c)
  3. getFirstDayOfMonth(Date date)
  4. getFirstDayOfMonth(Date date)
  5. getFirstDayOfMonth(Date date)
  6. getFirstDayOfMonth(Date date)
  7. getFirstDayOfMonth(Long date)
  8. getFirstDayOfNextMonth()
  9. getFirstDayStringOfMonth(Date date)