def round(round_sec = 1)
      down = self - (self.to_i % round_sec)
      up = down + round_sec

      difference_down = self - down
      difference_up = up - self

      if (difference_down < difference_up)
        return down
      else
        return up
      end
    end
def round(round_sec = 1)
      down = self - (self.to_i % round_sec)
      up = down + round_sec

      difference_down = self - down
      difference_up = up - self

      if (difference_down < difference_up)
        return down
      else
        return up
      end
    end
def round ( round_sec = 1 ) down = self - ( self . to_i % round_sec ) up = down + round_sec difference_down = self - down difference_up = up - self if ( difference_down < difference_up ) return down else return up end end
Rounding to the given nearest number of seconds
Rounding to the given nearest number of seconds