in reply to "Should be a simple thing" not going well for me
I prefer DateTime::Format::DateManip over the module you have selected. This provides an object with all the exposed methods allowed for DateTime while still providing some parsing of date strings.
#! C:/Perl/bin/perl use Modern::Perl; use DateTime::Format::DateManip; my $dt = DateTime::Format::DateManip->parse_datetime( "2011-07-24T17:46:33Z" ); say $dt; # Lock down the parsed time zone $dt->set_time_zone( 'UTC' ); say $dt; # change the time zone $dt->set_time_zone( "America/North_Dakota/Center" ); say $dt;
Output
# 2011-07-24T17:46:33 # 2011-07-24T17:46:33 # 2011-07-24T12:46:33
|
|---|