![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
I am trying to find out the time on different timezone by using the TZ variable.
However, the timezone using the country code is differnet from using the GMT code. For example: for HK ,GMT+8 for Japan, GMT+9 for Aus ,GMT+10 so i write the follow script to test on it. # cat check.sh d=`TZ=$* date` echo "Today is `date` ; $* = `echo $d`"# try some output on below: Today is Sun Aug 6 06:07:29 HKT 2006 ; Hongkong = Sun Aug 6 06:07:29 HKT 2006 Today is Sun Aug 6 06:07:29 HKT 2006 ; GMT+8 = Sat Aug 5 14:07:29 GMT 2006 Today is Sun Aug 6 06:07:29 HKT 2006 ; Japan = Sun Aug 6 07:07:29 JST 2006 Today is Sun Aug 6 06:07:29 HKT 2006 ; GMT+9 = Sat Aug 5 13:07:29 GMT 2006 Today is Sun Aug 6 06:07:29 HKT 2006 ; Australia/NSW = Sun Aug 6 08:07:29 EST 2006 Today is Sun Aug 6 06:07:29 HKT 2006 ; GMT+10 = Sat Aug 5 12:07:29 GMT 2006 Using the GMT will get a wrong result of time. Does anyone know what wrong on setting this TZ ? Thanks Last edited by userking; 08-06-2006 at 02:25 AM.. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|