[Denver-pm] Fwd: Simplifying Time?

Jay Hannah jay at jays.net
Thu Mar 20 10:56:02 PDT 2014


FYI, Denver folk.  :)


Begin forwarded message:
> From: Sterling Hanenkamp <sterling at hanenkamp.com>
> Subject: Re: [Omaha.pm] Simplifying Time?
> Date: March 20, 2014 at 12:52:57 PM CDT
> To: "Perl Mongers of Omaha, Nebraska USA" <omaha-pm at pm.org>
> Reply-To: "Perl Mongers of Omaha, Nebraska USA" <omaha-pm at pm.org>
> 
> If you use DateTime instead of Class::Date, there's the DateTime::Duration class which will let you add durations:
> 
> my $duration = DateTime::Duration->new( seconds => 15 );
> $duration->add( seconds => 73 );
> $duration->add( weeks => 12 );
> 
> There are some modules to help with formatting durations too. I think the nicest of which is this one:
> 
> https://metacpan.org/pod/DateTime::Format::Human::Duration
> 
> It's a pretty nice module.
> 
> -- 
> Andrew Sterling Hanenkamp
> sterling at hanenkamp.com
> 785.370.4454

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/denver-pm/attachments/20140320/57cc2e7a/attachment.html>


More information about the Denver-pm mailing list