Code example for DateFormat

Methods: format, setTimeZone

0
    } 
 
    private void updateClock() { 
        mCalendar.setTimeInMillis(System.currentTimeMillis());
        if (mTimeZone != null) {
            mDateFormat.setTimeZone(mTimeZone);
        } 
        setText(mDateFormat.format(mCalendar.getTime()));
        invalidate();
    } 
 
    private class FormatChangeObserver extends ContentObserver {
        public FormatChangeObserver() { 
            super(new Handler());
        } 
 
        @Override 
        public void onChange(boolean selfChange) {
            setFormat(); 
        } 
    }