Skip to content

Instantly share code, notes, and snippets.

@lambdamusic
Last active October 12, 2021 10:00
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 lambdamusic/4a5b852c8f9051b1f29033619cd38e36 to your computer and use it in GitHub Desktop.
Save lambdamusic/4a5b852c8f9051b1f29033619cd38e36 to your computer and use it in GitHub Desktop.
World date from the terminal
#!/bin/bash
wdate () {
search=$1;
zoneinfo=/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pytz/zoneinfo/;
format='%a %F %T';
find -L $zoneinfo -type f \
| grep -i "$search" \
| while read z
do
d=$(TZ=$z date +"$format")
printf "%-34s %23s\n" ${z#$zoneinfo} "$d"
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment