Skip to content

Instantly share code, notes, and snippets.

@port19x
Created August 31, 2023 08:05
Show Gist options
  • Save port19x/5093050d4767dafd81b1ecc4c0ce30bc to your computer and use it in GitHub Desktop.
Save port19x/5093050d4767dafd81b1ecc4c0ce30bc to your computer and use it in GitHub Desktop.
Global Timezones Zsh Function

Just a small function I just added to my zshrc.

Preview

2023-08-31_10-04

Code

global() {
    printf "Local:   %s\n" $(date +%H:%M)
    printf "\33[2K\r\033[1;32mIndia:   %s\033[0m\n" $(TZ="Asia/Kolkata" date +%H:%M)
    printf "\33[2K\r\033[1;31mUS West: %s\033[0m\n" $(TZ="America/Phoenix" date +%H:%M)
    printf "\33[2K\r\033[1;34mUS East: %s\033[0m\n" $(TZ="America/Atlanta" date +%H:%M)
    printf "\33[2K\r\033[1;33mNepal:   %s\033[0m\n" $(TZ="Asia/Kathmandu" date +%H:%M)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment