Subject: | Asia/Shanghai does not properly represent GMT+8 |
normally, Asia/Shanghai and Asia/Hong_Kong represents the same timezone:
+0800
but it seems that Date::Manip improperly translates Asia/Shanghai to
'CST'(China standard time), which has the same abbreviation of Central
standard time in north america which is -0600 and confused with them.
$ perl -v
This is perl, v5.8.8 built for x86_64-linux-thread-multi
$ uname -a
Linux zjm_20_201 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:39 EDT 2010
x86_64 x86_64 x86_64 GNU/Linux
$ cat date.pl
use Date::Manip;
use Data::Dumper;
print Dumper UnixDate('today 00:00', '%Y %b %d %H:%M:%S %z');
print Dumper UnixDate('now', '%Y %b %d %H:%M:%S %z');
print Dumper Date_TimeZone();
$ TZ='Asia/Shanghai' perl date.pl
$VAR1 = '2010 Oct 29 00:00:00 -0600';
$VAR1 = '2010 Oct 29 13:43:40 -0600';
$VAR1 = 'CST';
$ TZ='Asia/Hong_Kong' perl date.pl
$VAR1 = '2010 Oct 29 00:00:00 +0800';
$VAR1 = '2010 Oct 29 13:43:40 +0800';
$VAR1 = 'HKT';