Skip to content

Instantly share code, notes, and snippets.

@ElijahLynn
Last active March 14, 2017 02:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ElijahLynn/d6c16c27ec6ec5f14e1032bb58963d51 to your computer and use it in GitHub Desktop.
Save ElijahLynn/d6c16c27ec6ec5f14e1032bb58963d51 to your computer and use it in GitHub Desktop.
Quickly change timezone from the command line
# I make an abbreviation with `abbr --add ct change_timezone` and then just type `ct ny`.
function change_timezone --description "Change timezone to; LA or NY"
set --local zone $argv[1]
if string match --ignore-case --quiet 'LA' $zone
timedatectl set-timezone America/Los_Angeles
echo 'set zone to America/Los_Angeles'
else if string match --ignore-case --quiet 'NY' $zone
timedatectl set-timezone America/New_York
echo 'set zone to America/New_York'
else
echo 'timezone not recognized, must be LA or NY'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment