I have a setTime function

local function setTime(result,speed)
	local TimeSetInfo = TweenInfo.new(speed)
	local goal = {ClockTime = result}
	local Tween = TweenService:Create(Lighting,TimeSetInfo,goal)
	Tween:Play()
	wait(speed)
end

I want the night and day to be different lengths when I set the time to 17.67 at a certain speed then go to 6 it goes backwards is there any way to force the time to go forward