Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Getting hours From os.Time()?

How do you get hours from os.Time()?

I tried;

print(((os.time()/3600)%60))

and

print(((os.time()/3600)%60+(os.difftime(tick(),os.time())/3600)))

But they print out weird numbers.

1 answer

✓ Accepted answer
print(os.time()/(60*60));

That'll print out how many hours have passed since Epoch. If you wanted it to be the hours since the start of the day, it's like this:

print((os.time()%(60*60*24))/(60*60))

Source

This discussion is preserved as it was. New answers, comments, and votes are closed.