Code example for Calendar

Methods: get, setTimeInMillis

0
    public Calendar getCalendar() {
        return mCal;
    } 
 
    public void setTime(long milliseconds) {
        mCal.setTimeInMillis(milliseconds);
        invalidateCalendar(); 
    } 
 
    public void setTime(Calendar time) {
        mCal.setTimeInMillis(time.getTimeInMillis());
        invalidateCalendar(); 
    } 
 
    private void invalidateCalendar() { 
        Spinner monthSpinner = (Spinner) getChildAt(0);
        monthSpinner.setSelection(mCal.get(Calendar.MONTH));
        Spinner daySpinner = (Spinner) getChildAt(1);
        daySpinner.setSelection(mCal.get(Calendar.DAY_OF_MONTH) - 1);
        Spinner yearSpinner = (Spinner) getChildAt(2);
        yearSpinner.setSelection(mCurrentYear - getMinYear());
    } 
 
    public int getMinYear() {