IST에서 EST로 시간을 변경하는 데 다음 코드를 사용하고 있습니다 ... 그러나 Perl이 "잘못된 오프셋 : IST"라고 표시하고 'EST' 유효하지 않은 이름입니다. ?. Perl에서 IST 날짜를 EST 날짜로 변환하는 중 오류가 발생했습니다.
어느 한 도와 주실 래요 "대신 IST의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";
에 대한 http://search.cpan.org/dist/DateTime-TimeZone/lib/DateTime/TimeZone.pm 및 http://en.wikipedia.org/wiki/Tz_database를 참조하십시오. 대신에'DateTime :: Format :: Strptime-> new (...)'를 사용하십시오. –