Perl转换时区会产生错误的输出

Siv*_*iva 0 perl timezone timezone-offset

尝试基于此将给定时间从一个时区转换为另一个时区.但输出是错误的.尝试了不同的价值但没有运气.什么帮助什么失踪?

use Date::Manip::DM6;
use DateTime::Format::DateManip;

my $date2 = '2015-03-24 06:00:00';
$date1 = DateTime::Format::DateManip->parse_datetime( $date2);

my $newdate= UnixDate(Date_ConvTZ($date1 , 'EST', 'PST' ),"%Y-%m-%d %T");
print "date is $date1 and newdate is $newdate";
Run Code Online (Sandbox Code Playgroud)

E:> perl test.pl

日期是2015-03-24T06:00:00,newdate是2015-03-23 12:00:00

预期结果是newdate => 2015-03-24 03:00:00

Sch*_*ern 6

有两个EST和两个AST和两个PST以及五个CST.

AST     Arabia Standard Time                    UTC+03
AST     Atlantic Standard Time                  UTC?04

EST     Eastern Standard Time (North America)   UTC?05
EST     Eastern Standard Time (Australia)       UTC+10

PST     Pacific Standard Time (North America)   UTC?08
PST     Philippine Standard Time                UTC+08
Run Code Online (Sandbox Code Playgroud)

通常,避免使用时区缩写,因为它们不明确.改为使用偏移量.

当我在没有DateTime :: Format :: DateManip(我无法通过测试)的情况下运行代码时,我得到了您期望的结果.

use v5.10;
use Date::Manip::DM6;

say UnixDate(
    Date_ConvTZ("2015-03-24 06:00:00", "EST", "PST"),
    "%Y-%m-%d %T"
);
# 2015-03-24 03:00:00
Run Code Online (Sandbox Code Playgroud)

但是,不要在日期库上赌博,为你的时区缩写选择相同的含义,只是不要使用它们.