[Omaha.pm] DateTime::Duration ->days()

Jay Hannah jhannah at mutationgrid.com
Fri Jan 14 19:17:07 PST 2011


On Jan 14, 2011, at 9:03 PM, Jay Hannah wrote:
> What the heck? Why is DateTime so popular? Date::Calc and Class::Date make this trivial.

See? Easy...


$ cat j2.pl
use 5.12.0;
use Date::Calc qw(Delta_Days);

say sprintf('$%0.2f', 1025 / Delta_Days(2007, 5, 15, 2011, 1, 14));

$ perl j2.pl
$0.76


My laptop died today. And that's how much money it cost me per day I owned it. Used it daily. Not bad.  :)

   http://www.facebook.com/photo.php?pid=1500762&l=fe015d08cb&id=1032415362

Thanks,

Jay Hannah
Software Architect
jhannah at mutationgrid.com | http://mutationgrid.com | 1-402-598-7782







More information about the Omaha-pm mailing list