Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local TargetDate = os.time({year=2023, month=8, day=28, hour=14, min=0, sec=0})
- function ConvertToDHMS(Days,Hours,Minutes,Seconds)
- return string.format("%dd %02dh %02dm %02ds", Days, Hours, Minutes, Seconds)
- end
- function UpdateCountdownDisplay()
- -- Change: 5 to whatever your timezone is (EG. New York = - 5)
- local Time = os.date("!*t", os.time() - 5* 60 * 60)
- local CurrentDate = os.time(Time)
- local SecondsLeft = TargetDate - CurrentDate
- local days = math.floor(SecondsLeft / (24 * 60 * 60))
- local hours = math.floor((SecondsLeft % (24 * 60 * 60)) / (60 * 60))
- local minutes = math.floor((SecondsLeft % (60 * 60)) / 60)
- local seconds = math.floor(SecondsLeft % 60)
- game.Workspace.CountdownPart.SurfaceGui.CountdownText.Text = ConvertToDHMS(days, hours, minutes, seconds)
- end
- while true do
- UpdateCountdownDisplay()
- wait(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement