Created
July 23, 2023 09:08
-
-
Save nicc777/731f5cce0055dd92cc756af10f518d42 to your computer and use it in GitHub Desktop.
Command Line World Clock
This file contains hidden or 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
#!/bin/sh | |
# Command-line world clock - source: https://stackoverflow.com/questions/370075/command-line-world-clock | |
: ${WORLDCLOCK_ZONES:=$HOME/world_time_zones} | |
: ${WORLDCLOCK_FORMAT:='+%Y-%m-%d %H:%M:%S %Z'} | |
while read zone | |
do echo $zone '!' $(TZ=$zone date "$WORLDCLOCK_FORMAT") | |
done < $WORLDCLOCK_ZONES | | |
awk -F '!' '{ printf "%-20s %s\n", $1, $2;}' |
This file contains hidden or 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
Europe/Amsterdam | |
Europe/London | |
Africa/Johannesburg | |
Pacific/Auckland | |
Australia/Brisbane |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment