Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: "Should be a simple thing" not going well for me

by jandrew (Hermit)
on Nov 03, 2011 at 16:03 UTC ( #935697=note: print w/ replies, xml ) Need Help??

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;


# 2011-07-24T17:46:33 # 2011-07-24T17:46:33 # 2011-07-24T12:46:33

Comment on Re: "Should be a simple thing" not going well for me
Select or Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://935697]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2016-02-07 04:27 GMT
Find Nodes?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?

    Results (246 votes), past polls