Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to use os.Time to print when its 8 pm?

Asked by
hokyboy 270 Moderation Voter
4 years ago
if os.Time("*T",hour) == 20 then
    print("Its Time")
end

And what timezone does this use? UTC? Or EST

0
check the wiki, it uses the UTC timezone. moo1210 587 — 4y

1 answer

Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

what you actually want to do is os.date("*t", os.time()). which will return a table, and then you can index .hour on it..

for instance:

local currentDate = os.date("*t", os.time())
if(currentDate.hour == 20) then
    print("it's 8 PM")
end

learn more here

0
thanks but what timezone does this use? hokyboy 270 — 4y
0
unsure User#23252 26 — 4y
Ad

Answer this question