How to get a country time?

PLS NOTE: I am new to dev forum so feel free to correct me :slight_smile:

ok so what I try to achieve is to get a country time using os.time()
for example Greece and make the server fire an event when for Greece is 12 pm how can I get the exact time of a country using os.time?(not users time)

You can use to get a dictionary of the current seconds, minutes etc in your localtime:

local date ="*t") --*t for local, !*t for UTC
print(date.year) --curently 2019
1 Like

Ah I see, well since os.time() is in seconds, then you can add the amount of seconds more than the UTC time.

You can make a simple function to do this:

function getTimeForZone(addedHours)
    return os.time() + ((60 * 60) * (addedHours + 1))

Since Greece is UTC+2 then you can do:


thanks i was using *t cause i didn’t knew the difference thanks for the help