Code example for Calendar

Methods: getTimeZone, setTimeInMillis

0
            String action = intent.getAction(); 
            if (action.equals(Intent.ACTION_TIMEZONE_CHANGED)) { 
                String tz = intent.getStringExtra("time-zone"); 
                mCalendar = Calendar.getInstance(TimeZone.getTimeZone(tz)); 
                if (mClockFormat != null) { 
                    mClockFormat.setTimeZone(mCalendar.getTimeZone()); 
                } 
            } 
            updateClock(); 
        } 
    }; 
 
    final void updateClock() { 
        mCalendar.setTimeInMillis(System.currentTimeMillis());
         
        if (mAmPmStyle == PROTEKK_O_CLOCK) {
        	setText("99:99");
        } else {	 
            setText(getSmallTime());
        }