Skip to content

Instantly share code, notes, and snippets.

@aseba
Last active June 15, 2020 12:57
Show Gist options
  • Save aseba/705507243f0331c05d2dd05a1d267c77 to your computer and use it in GitHub Desktop.
Save aseba/705507243f0331c05d2dd05a1d267c77 to your computer and use it in GitHub Desktop.
Bash Script to print several timezones at once
#!/bin/bash
#ls /usr/share/zoneinfo/
declare -a Timezones=("America/New_York" "Europe/London" "Europe/Madrid")
echo Home: `date +"%m-%d-%Y %T %z"`
for tz in ${Timezones[@]}; do
echo $tz: `env TZ=$tz date +"%m-%d-%Y %T %z"`
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment