Convert TimeOfDay to Seconds

Hi! I want to be able to get the In-game TimeOfDay to Seconds so I can add another Value that is in seconds to get the time where a thing should happen.

I have tried to use tonumber(TOD) but doesn’t really work, i know it wasn’t supposed to work but you can always try.

Have you got any ideas?

local hours, minutes, seconds = string.match(timeOfDay, "(%d+):(%d+):(%d+)")
local totalSeconds = hours*3600 + minutes*60 + seconds
print(totalSeconds)
1 Like

Thank you very much, I will be trying it and see if it works. Will get back to you shortly!

Thats Seem to work, Thank you very much!

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