Code example for TimeUnit

Methods: toSeconds

0
        // int diffMinutes = (int) TimeUnit.MILLISECONDS.toMinutes(diffMillis); 
        int diffMinutes = (int) (diffMillis / 1000L / 60L);
 
        // diffMillis -= TimeUnit.MINUTES.toMillis(diffMinutes); 
        diffMillis -= (diffMinutes * 60L * 1000L);
        int diffSeconds = (int) TimeUnit.MILLISECONDS.toSeconds(diffMillis);
 
        mCountdown.set(diffHours, diffMinutes, diffSeconds);
 
    } 
 
    public boolean isOld() { 
        if (mCountdown.getSeconds() < -58) {
            return true; 
        } 
        return false; 
    } 
 
    @Override 
    public String toString() {
        return mDayofweek + ":" + mHour + ":" + mMinutes + ":" + mStopat + ":" + mType;