ghyrha
Last Updated: February 25, 2016
·
2.09K
· LuRsT
43d7035caeafc49de5d7568cbf73175e

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);