Java Month Calculate getStartOfMonth(Calendar scal)

Here you can find the source of getStartOfMonth(Calendar scal)

Description

Converts a calendar to the first day of the month

License

Apache License

Declaration

public static Calendar getStartOfMonth(Calendar scal) 

Method Source Code

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

import java.util.*;

public class Main {
    /**/*from   w ww .jav  a  2  s. co m*/
     * Converts a calendar to the first day of the month
     */
    public static Calendar getStartOfMonth(Calendar scal) {
        scal.add(Calendar.DAY_OF_MONTH, -(scal.get(Calendar.DAY_OF_MONTH) - 1));
        return scal;
    }
}

Related

  1. getMonthsOfAge(Date birth, Date now)
  2. getMonthSpan(Date begin, Date end)
  3. getNextMonth(long date)
  4. getNextMonthExtention(Date dt, Long n)
  5. getNowMonth()
  6. getThisMonthEnd()
  7. getThisMonthStart()
  8. incrementMonth(long date, int increment)
  9. intToCalendarMonth(int month)