Why is this printing a completley different number?

I’m making a subscription system and for some reason it’s adding 18,000 days instead of just 1.

image

Any help is appreciated, I have left the script below.

ServerScript
local DataStoreService = game:GetService("DataStoreService")
local FresheData = require(game:GetService("ReplicatedStorage").FresheModular.FresheData)
local MembershipData = DataStoreService:GetDataStore(FresheData.MembershipDatastoreKey)
local MarketPlaceService = game:GetService("MarketplaceService")



local Times = {
	Day = {
		Type = "Day",
		Duration = 86400,
		ProductID = 1139368818,
	},
	Week = {
		Type = "Week",
		Duration = 604800,
		ProductID = 1139368754,
	},
	Month = {
		Type = "Month",
		Duration = 2628000,
		ProductID = 1139368667,
	},
	Year = {
		Type = "Year",
		Duration = 31536000,
		ProductID = 1139368883,
	},
}



function disp_time(Seconds)
	local days = math.floor(Seconds / 86400)
	local hours = math.floor(days / 3600)
	local minutes = math.floor(hours /60)
	local seconds = math.floor(minutes /60)
	local Table = {
		
		Days = days,
		Hours = hours,
		Minutes = minutes,
		seconds = seconds,
		
	}
	return Table
end


-- Purchase Handler
MarketPlaceService.ProcessReceipt = function(PurchaseInfo)
	print("Purchase Processing...")
	local Player = game:GetService("Players"):GetPlayerByUserId(PurchaseInfo.PlayerId)
	for _, Time in pairs(Times) do
		print("For Times"..Time.Type)
		if PurchaseInfo.ProductId == Time.ProductID then
			print("product = product yes")
			-- Get info
			local MembershipTime = Player.Membership.MembershipTime.Value
			-- Save info
			local UntilTime
			-- Checks if user already purchased membership in case
			if os.time() <= MembershipTime then
				UntilTime = MembershipTime + Time.Duration
			else
				UntilTime = os.time() + Time.Duration
			end
			local Success,Error = pcall(function()
				MembershipData:SetAsync(Player.UserId.."-FreshePremium",UntilTime)
			end)

			-- Checks if successful
			if Success then
				Player.Membership.IsPremium.Value = true
				Player.Membership.MembershipTime.Value = UntilTime
				print("Purchase Granted! ".. Time.Type)
				local TimeLeft = disp_time(UntilTime)
				print("Days: "..TimeLeft.Days.." Hours: "..TimeLeft.Hours.." Minutes: "..TimeLeft.Minutes.." Seconds: "..TimeLeft.seconds)
				return Enum.ProductPurchaseDecision.PurchaseGranted
			else
				-- If there is an error, the purchase is not processed yet and it prints the error.
				print("Error while purchasing membership: "..Error)
				return Enum.ProductPurchaseDecision.NotProcessedYet
			end
			
		end
	end
end


game.Players.PlayerAdded:Connect(function(Player)
	print("PlayerAdded")
	-- Creates a folder in the Player containing the Player's Membership data
	local Folder = Instance.new("Folder",Player)
	Folder.Name = "Membership"
	local IsPremium = Instance.new("BoolValue",Folder)
	IsPremium.Name = "IsPremium"

	local MembershipTime = Instance.new("NumberValue",Folder)
	MembershipTime.Name = "MembershipTime"

	-- Gets membership data. Data will be the os.time() the membership expires
	local MembershipInfo
	local Success,Error = pcall(function()
		MembershipInfo = MembershipData:GetAsync(Player.UserId.."-FreshePremium")
	end)

	-- Loads data
	if not MembershipInfo then MembershipInfo = 0 end -- Sets to 0 if no data given
	MembershipTime.Value = MembershipInfo
	if os.time() <= MembershipInfo then
		IsPremium.Value = true
	else
		IsPremium.Value = false
	end
	while true do
		wait(30)
		if os.time() <= MembershipInfo then
			IsPremium.Value = true
		else
			IsPremium.Value = false
		end
	end
end)


Fixed this, due to os.time being added to membership time.