in reply to DateTime speed improvement - suggestion
You don't need the ->clone in there. The following should be sufficient:
$dhms = DateTime->new( ..., time_zone => 'Etc/UTC', formatter => $formatter, ); $dhms->set_time_zone('America/New_York');
Another possible speed up (though I don't think it's likely to make much difference) is to move the timezone lookup outside the loop:
my $formatter = ...; my $utc = DateTime::TimeZone->new(name => "Etc/UTC"); my $nyc = DateTime::TimeZone->new(name => "America/New_York"); while (<>) { ...; $dhms = DateTime->new( ..., time_zone => $utc, formatter => $formatter, ); $dhms->set_time_zone($nyc); }
|
|---|