Android Month Date Get getStartCurrentMonthCal()

Here you can find the source of getStartCurrentMonthCal()

Description

get Start Current Month Cal

Declaration

public static Calendar getStartCurrentMonthCal() 

Method Source Code

//package com.java2s;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

public class Main {
    public static Calendar getStartCurrentMonthCal() {
        Calendar calendar = getCalendar();
        calendar.set(Calendar.DAY_OF_MONTH,
                calendar.getActualMinimum(Calendar.DAY_OF_MONTH));
        calendar.set(Calendar.HOUR_OF_DAY, 0);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        calendar.set(Calendar.MILLISECOND, 0);

        return calendar;
    }/*from  w  w w .  jav  a  2  s  .  co m*/

    private static Calendar getCalendar() {
        Calendar calendar = GregorianCalendar.getInstance();
        calendar.setTime(new Date());
        return calendar;
    }
}

Related

  1. getMonth(int month, Locale locale)
  2. getMonthName(String substring)
  3. getEndCurrentMonth()
  4. getEndCurrentMonthCal()
  5. getStartCurrentMonth()