Code example for Date

Methods: getDategetMonthgetYear

0
                month = c.get(Calendar.MONTH);
                day = c.get(Calendar.DAY_OF_MONTH);
            } else { 
                Date dateToShow = this.getTag().equals("Start") ? startDate : endDate;
 
                year = dateToShow.getYear();
                month = dateToShow.getMonth();
                day = dateToShow.getDate();
            } 
 
            return new DatePickerDialog(getActivity(), this, year, month, day);
        } 
 
        @Override 
        public void onDateSet(DatePicker arg0, int year, int monthOfYear, int dayOfMonth) {
            if (this.getTag().equals("Start")) {
                startDate = new Date(year, monthOfYear, dayOfMonth);
                startDateView.setText(String.format("%s-%02d-%04d", new DateFormatSymbols().getMonths()[monthOfYear], dayOfMonth, year));
            } else { 
                endDate = new Date(year, monthOfYear, dayOfMonth);
Stop searching for code, let great code find you!  Add Codota to your java IDE