How do I get the current time in UTC

Hello, I was wondering how you would make some kind of live event thing. I mostly just need help with getting the time in a certain time zone. I’ve read through the documentation but I still don’t fully understand it.

Thank you.

print("!*t")) -- prints the current time in UTC
-- example usage
local utc_time ="!*t") -- the current time in UTC

local day = -- the day of the month
local month = utc_time.month -- the month (integer)
local year = utc_time.year -- the year 

print("today is", string.format("%s/%s/%s", day, month, year)) 
-- prints (as of writing this) 
-- "today is 22/12/2020"

-- you could use a different date/string format

Alternatively, you can use DateTime


Okay, I’ll check it out, thanks!

1 Like