How do get timezone

who know get timezone? like istanbul timezone utc time zone but i dont know how to do this

Are you trying to get the UTC offset from local timezone? If yes, then you can do it like this

local timezone = os.date("%z")
print(timezone) -- RETURNS DATA IN ISO 8601 FORMAT (+0300)

Formatted:

local formattedtimezone = "UTC"..os.date("%z"):sub(1,3)
print(formattedtimezone) -- UTC+03
3 Likes

theres get other timezones? or only utc timezone?

You can try DateTime or external API. Keep in mind external api will only work for the server. DateTime

1 Like

thanks, its will be useful for me (i will do real time night day script)