Skip to content

Instantly share code, notes, and snippets.

@colemickens
Created July 4, 2019 16:25
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 colemickens/d4603e1f3cbdbeebb99dc32902d8f63e to your computer and use it in GitHub Desktop.
Save colemickens/d4603e1f3cbdbeebb99dc32902d8f63e to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -euo pipefail
declare -A timezones=( ["SEA"]=":US/Pacific" ["TOP"]=":US/Central" ["HAM"]=":Europe/Berlin" )
result=""
for K in "${!timezones[@]}"; do
time="$(env TZ="${timezones["$K"]}" date '+%e %H:%H:%S')"
result="${result}${K}[${time} ] "
done
result="${result%" "}"
printf "%s" "${result}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment