public static long roundDate(long date, int seconds) {
        return date - (date % (1000 * seconds));
    }
Rounds the given date down to the nearest specified second.

@param date the date (as a long) that we want to round.
@param seconds the number of seconds we want to round the date to.
@return the given date (as a long), rounded down to the nearest
        specified number of seconds.
xmppserver/src/main/java/org/jivesoftware/openfire/SessionResultFilter.java