Last Updated: February 25, 2016
·
5.417K
· LuRsT

Convert dates in perl ( str2time )

use Date::Parse;
use DateTime;

my $str = "Tue, 20 Sep 2011 08:51:08 -0500";
my $epoch = str2time($str);
my $datetime = DateTime->from_epoch(epoch => $epoch);