public static long roundDownTimeStampSeconds(long timestamp, int roundDownSec, TimeZone timeZone)
      throws IllegalStateException {
    Preconditions.checkArgument(roundDownSec > 0 && roundDownSec <= 60,
        "RoundDownSec must be > 0 and <=60");
    Calendar cal = roundDownField(timestamp, Calendar.SECOND, roundDownSec, timeZone);
    cal.set(Calendar.MILLISECOND, 0);
    return cal.getTimeInMillis();
  }
public static long roundDownTimeStampSeconds ( long timestamp , int roundDownSec , TimeZone timeZone ) throws IllegalStateException { Preconditions . checkArgument ( roundDownSec > 0 && roundDownSec <= 60 , "RoundDownSec must be > 0 and <=60" ) ; Calendar cal = roundDownField ( timestamp , Calendar . SECOND , roundDownSec , timeZone ) ; cal . set ( Calendar . MILLISECOND , 0 ) ; return cal . getTimeInMillis ( ) ; }
@param timestamp - The time stamp to be rounded down.
@param roundDownSec - The <tt>timestamp</tt> is rounded down to the largest
multiple of <tt>roundDownSec</tt> seconds
less than or equal to <tt>timestamp.</tt> Should be between 0 and 60.
@param timeZone - The timezone to use for parsing the <tt>timestamp</tt>.
@return - Rounded down timestamp
@throws IllegalStateException