Last active
March 14, 2017 02:41
-
-
Save ElijahLynn/d6c16c27ec6ec5f14e1032bb58963d51 to your computer and use it in GitHub Desktop.
Quickly change timezone from the command line
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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