use warnings; use strict; use DateTime; use DateTime::Format::Strptime; my $fmt = '%d %b %Y %T %z'; my $strp = DateTime::Format::Strptime->new( on_error=>'croak', pattern=>$fmt ); my $dt = DateTime->now; $dt->set_time_zone('America/Chicago'); # try this with "%Z"... print $dt->rfc3339, "\n"; my $str = $dt->strftime($fmt); print "$str\n"; my $dt2 = $strp->parse_datetime($str); print $dt2->rfc3339, "\n";