Yeah, that will return the time in UTC, which will be the same regardless of what timezone the client or the server are in.
In order to implement your usecase of expiring Twitter codes, you can use this:
local timeValue = os.time({
year = 2019,
month = 5, -- May
day = 5,
hour = 13,
minute = 16
})
to get the time value for when it will expire. Note that the time values passed into this function are in UTC. Then, you can just use os.time() < timeValue
to tell whether the code is still valid. I recommend performing this check server-side, because players can adjust their local clocks to any value they want.
To show the user how much time is left before the code expires, you could do:
local delta = timeValue - os.time()
local seconds = math.floor(delta) % 60
local minutes = math.floor(delta / 60) % 60
local hours = math.floor(delta / 60 / 60) % 60
local days = math.floor(delta / 60 / 60 / 24) % 60
local prettyString = string.format("%d days and %02d:%02d:%02d left!", days, hours, minutes, seconds)
print(prettyString)