Os.time printing incorrect time

Hello Developers,

I’m currently working on some sort of live time manager for a project I’m working on. I’m coming across this issue where os.time is printing the wrong time by an hour and I can’t work out why.

local timeTable = os.date("!*t", os.time())
print(timeTable.hour.. ":" .. timeTable.min)

My current local time is 08.16 AM but the script is printing 07.16AM.
image

Any help would be appreciated thank you. :heart:

“!*t” will format the time to UTC, “*t” will format it to your local time. Keep in mind though that if this is used in a server script, the local time will depend on which region the server is in.

1 Like

That’s it! Thank you for your help.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.