Here you can find the source of calcThisMonth(String begin, String end, String now, GregorianCalendar calendar)
public static void calcThisMonth(String begin, String end, String now, GregorianCalendar calendar)
//package com.java2s; //License from project: Apache License import java.util.GregorianCalendar; public class Main { public static void calcThisMonth(String begin, String end, String now, GregorianCalendar calendar) { end = now;// w ww . ja va 2 s .c o m int dayOfMonth = calendar.get(GregorianCalendar.DATE); calendar.add(GregorianCalendar.DATE, -dayOfMonth + 1); begin = new java.sql.Date(calendar.getTime().getTime()).toString(); System.out.println(" begin: " + begin); System.out.println(" end: " + end); System.out.println(" ---------------------- "); } }