Hello! I am trying to program a live event, and I had it all working fine but the countdown is in seconds (I was using UNIX time.) how would I go about making a countdown with days/hours/minutes/seconds, like Jailbreak did with their live event?
everything there should work, except put the “if currenttime >= stopTime then” and the two lines below it right below where you define CurrentTime so the live event doesnt play for new servers after it happened
Yeah, I don’t want it to play for new servers after the StopTime, but my problem is how would I make the time in seconds, turn into days,hours,minutes etc.
You’re basically getting the days, hours, minutes and seconds from the UNIX epoch. This can be used to get the time until a point of time in the future:
local t = startTime - CurrentTime
local seconds = t % 60
local minutes = math.floor(t / 60) % 60
local hours = math.floor(t / 3600) % 24
local days = math.floor(t / 86400)