Skip to content

Instantly share code, notes, and snippets.

@gaymeowing
Last active August 20, 2024 02:17
Show Gist options
  • Save gaymeowing/d9e1dd5cb605408f582f3ac144cb266f to your computer and use it in GitHub Desktop.
Save gaymeowing/d9e1dd5cb605408f582f3ac144cb266f to your computer and use it in GitHub Desktop.
--!native
-- abbrev timezone
-- simple function for getting a timezone in its abbreviated form
-- ie EST (Eastern Standard Time)
local GSUB = string.gsub
local DATE = os.date
local function abbrev_timezone(offset: number?): string
return (GSUB(DATE("%Z", offset), "%U", ""))
end
return abbrev_timezone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment