Here you can find the source of getNextMonthStartDate(Date date)
public static Timestamp getNextMonthStartDate(Date date)
//package com.java2s; //License from project: Open Source License import java.sql.Timestamp; import java.util.Calendar; import java.util.Date; public class Main { public static Timestamp getNextMonthStartDate(Date date) { Calendar rightNow = Calendar.getInstance(); rightNow.setTime(date);//from w ww .ja va 2 s.com rightNow.set(Calendar.DAY_OF_MONTH, 1); rightNow.set(Calendar.HOUR_OF_DAY, 0); rightNow.set(Calendar.MILLISECOND, 0); rightNow.set(Calendar.SECOND, 0); rightNow.set(Calendar.MINUTE, 0); rightNow.set(Calendar.MONTH, rightNow.get(Calendar.MONTH) + 1); return new Timestamp(rightNow.getTimeInMillis()); } }