在perl中将IST日期转换为EST日期时出错

use*_*114 1 perl datetime-format

我使用以下代码将时间从IST更改为EST ...但Perl说"无效偏移:IST"并且无法加载时区"EST",或者名称无效.

任何人都可以帮忙吗?"

use DateTime; 
use DateTime::Format::Strptime;  
my $val = "20090103 12:00";  
my $format = new DateTime::Format::Strptime(                 
                    pattern => '%Y%m%d %H:%M',          
                                            time_zone => 'IST',                 );  
my $date = $format->parse_datetime($val);  
print $date->strftime("%Y%m%d %H:%M %Z")."\n";  
$date->set_time_zone('EST');  
print $date->strftime("%Y%m%d %H:%M %Z")."\n"; 
Run Code Online (Sandbox Code Playgroud)

Tot*_*oto 5

根据这个网站,IST用于几个国家:

IST Israel Standard Time    Asia    UTC + 2 hours
IST India  Standard Time    Asia    UTC + 5:30 hours
IST Irish  Standard Time    Europe  UTC + 1 hour
Run Code Online (Sandbox Code Playgroud)

因此,IST使用例如,而不是使用Europe/Dublin