Skip to content

Instantly share code, notes, and snippets.

@7171u
Last active June 5, 2021 16:48
Show Gist options
  • Save 7171u/cb709f4b3e746ec8f984bff6639900e0 to your computer and use it in GitHub Desktop.
Save 7171u/cb709f4b3e746ec8f984bff6639900e0 to your computer and use it in GitHub Desktop.
List Timezones Using Bash
#!/usr/bin/env bash
for tz in Asia/Kolkata US/Eastern Europe/Berlin Asia/Dubai Asia/Singapore Australia/Sydney; do
echo -en "\n$tz "
for i in $(seq -f %02g 0 23); do
echo -n $(TZ=":${tz}" date --date="TZ=\"Asia/Kolkata\" ${i}00" +%H:%M )" "
done
echo ""
done | column -s " " -t 2>/dev/null
@7171u
Copy link
Author

7171u commented Jun 5, 2021

Output:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment