Created
April 11, 2012 09:01
-
-
Save mrkschan/2358097 to your computer and use it in GitHub Desktop.
a shortcut program to convert timezone
This file contains 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 | |
# Usage: tz.sh from-timezone to-timezone time | |
# Example: tz.sh America/Los_Angeles America/New_York '2000-01-01 00:01:02' | |
from=$1 | |
to=$2 | |
if [[ "$3" == "" ]]; then | |
time=`date -R` | |
else | |
time=$3 | |
fi | |
TZ="$from" date -R --date "$time" | TZ="$to" xargs -I {} date -R --date {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment