Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- math.randomseed(tick())
- function GetLocalTime()
- local TiF = "%.2d:%.2d:%.2d"
- local t = tick()
- return TiF:format(math.floor((t/3600)%24),math.floor((t/60)%60),math.floor((t%60)))
- end
- while wait() do
- script.Parent.Text = GetLocalTime()
- local hours, mins = string.match(script.Parent.Text, "^(%d%d):(%d%d)")
- if tonumber(hours) > 12 then
- hours = hours - 12
- script.Parent.Text = hours..":"..mins.." PM"
- else
- script.Parent.Text = hours..":"..mins.." AM"
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement