Java Utililty Methods Date to Quarter

List of utility methods to do Date to Quarter

Description

The list of methods to do Date to Quarter are organized into topic(s).

Method

intgetQuarterYear(Date dateParam)
get Quarter Year
if (dateParam == null) {
    throw new IllegalArgumentException("The dateParam  must not be null");
Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(dateParam.getTime());
return cal.get(Calendar.MONTH) / 3 + 1;
DategetQuaterStart(Date date)
get Quater Start
Calendar cal = cal(date, 0, 0);
int quater = cal.get(MONTH) / 3;
cal.set(MONTH, quater * 3);
cal.set(DATE, 1);
return cal.getTime();