Java Month Calculate startOfMonthDate(Date date)

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

Description

start Of Month Date

License

Open Source License

Declaration

static public Date startOfMonthDate(Date date) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.*;

public class Main {
    static public Date startOfMonthDate(Date date) {
        Calendar now = Calendar.getInstance();
        now.setTime(date);//from www . java  2s  .  c om
        now.set(Calendar.DAY_OF_MONTH, 1);
        now.set(Calendar.HOUR_OF_DAY, 0);
        now.set(Calendar.MINUTE, 0);
        now.set(Calendar.SECOND, 0);
        now.set(Calendar.MILLISECOND, 0);
        return now.getTime();
    }
}

Related

  1. monthsBetween(String pFormerStr, String pLatterStr)
  2. nextMonth(Date date, int months)
  3. nextMonths(int diff)
  4. startOfMonth(Date d)
  5. startOfMonth(Date date)
  6. truncateMonth(Date d)