public static long getTimeInMsToTheNearestSec(long timeInMs) {
    long timeInSecs = timeInMs / Time.MsPerSec;
    return timeInMs != Utils.Infinite_Time ? (timeInSecs * Time.MsPerSec) : Utils.Infinite_Time;
  }
Convert ms to nearest second(floor) and back to ms to get the approx value in ms if not for
{@link Utils#Infinite_Time}.
@param timeInMs the time in ms that needs to be converted
@return the time in ms to the nearest second(floored) for the given time in ms
ambry-utils/src/main/java/com/github/ambry/utils/Utils.java