Code example for Time

Methods: setToNow, switchTimezone

0
      hand.draw(canvas);
      canvas.restore();
    } 
 
    private void onTimeChanged() { 
        mCalendar.setToNow();
 
        if (mTimeZoneId != null) {
            mCalendar.switchTimezone(mTimeZoneId);
        } 
 
        int hour = mCalendar.hour;
        int minute = mCalendar.minute;
        int second = mCalendar.second;
  //      long millis = System.currentTimeMillis() % 1000; 
 
        mSeconds = second;//(float) ((second * 1000 + millis) / 166.666);
        mMinutes = minute + second / 60.0f;
        mHour = hour + mMinutes / 60.0f;
        mChanged = true;