Skip to content

Instantly share code, notes, and snippets.

@mricon
Last active October 11, 2015 12:47
Show Gist options
  • Save mricon/3860883 to your computer and use it in GitHub Desktop.
Save mricon/3860883 to your computer and use it in GitHub Desktop.
Quick timezone chart
#!/bin/bash
WANT=$1
dotime () {
WANT=$1
PAC=`TZ='America/Vancouver' date +%H:%M -d "TZ=\"America/Montreal\" $WANT"`
MTN=`TZ='America/Denver' date +%H:%M -d "TZ=\"America/Montreal\" $WANT"`
CEN=`TZ='America/Chicago' date +%H:%M -d "TZ=\"America/Montreal\" $WANT"`
UTC=`TZ='Etc/UTC' date +%H:%M -d "TZ=\"America/Montreal\" $WANT"`
CST=`TZ='Asia/Shanghai' date +%H:%M -d "TZ=\"America/Montreal\" $WANT"`
SYD=`TZ='Australia/Sydney' date +%H:%M -d "TZ=\"America/Montreal\" $WANT"`
echo -e "$WANT\t\t$PAC\t$MTN\t$CEN\t\t$UTC\t$CST\t$SYD"
}
echo -e "Eastern\t\tPacific\tMountn\tCentral\t\tUTC\tChina\tSydney"
if [ -z "$WANT" ]; then
for HOUR in `seq 0 23`; do
dotime `printf %02d $HOUR`:00
done
elif [ "$WANT" = "now" ]; then
dotime `date +%H:%M`
else
dotime $WANT
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment