How to make a time counter with just a seconds value

I’m trying to make an accurate time counter in a 00:00:00 format, but I’m stumped
does anyone know what to do here?
So here is what I have.

seconds = val
minutes = val/60
hours = val/3600

Let’s say that val = 650. (that would be 650 seconds, 10.8 minutes, or 0.18 of an hour.)
So… how would i make it accurately divide all these numbers so that it would just say “00:10:50”?

local function FormatSeconds(x: number): string
	return os.date("!%X", x)
end

local Seconds = FormatSeconds(650)
print(Seconds) --00:10:50

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.