4
1
I found a solution about how to convert time zone with the Linux date
command:
Timezone conversion by command line
$ date --date='TZ="Asia/Taipei" 18:00'
Fri Jul 16 11:00:00 BST 2010
It's working great, but I can't figure it out how to use it in a Bash script, when time is a variable, like:
TIME=18:00
DATE="`date --date='TZ="Asia/Taipei" $TIME' +%F\ %H:%M`"
echo $DATE;
I have problems with escaping special characters. And I totally don't understand why the date
command works with timezones like BST, EET, etc. and not with timezones like "Asia/Taipei", Europe/Moscow, etc.