Last active
October 12, 2021 10:00
-
-
Save lambdamusic/4a5b852c8f9051b1f29033619cd38e36 to your computer and use it in GitHub Desktop.
World date from the terminal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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