Skip to content

Instantly share code, notes, and snippets.

@spk
Forked from oz/clock.sh
Last active December 17, 2015 07:19
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 spk/5571700 to your computer and use it in GitHub Desktop.
Save spk/5571700 to your computer and use it in GitHub Desktop.
#!/bin/sh
time_here=`date`
#COL=$(tput cols)
COL=60
AWESOME_TZ="UTC America/Los_Angeles America/Mexico_City America/New_York Europe/Paris Europe/Berlin Asia/Tokyo"
echo 'Awesome world clock:'
echo
echo "Local time:"
printf "%${COL}s\n" "${time_here}"
for tz in ${AWESOME_TZ}; do
tz_date=$(TZ=${tz} date)
echo "${tz}:"
printf "%${COL}s\n" "${tz_date}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment