Here you can find the source of getMonthStart(int year, int month)
Parameter | Description |
---|---|
year | a parameter |
month | a parameter |
public static Date getMonthStart(int year, int month)
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { /**// www. j a v a2 s. c om * Get the beginning time of a month * * @param year * @param month * @return */ public static Date getMonthStart(int year, int month) { Calendar cal = Calendar.getInstance(); cal.set(Calendar.YEAR, year); cal.set(Calendar.MONTH, month); cal.set(Calendar.DATE, 1); cal.set(Calendar.HOUR_OF_DAY, 0); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); return cal.getTime(); } }