Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Trouble with Dates

by Cristoforo (Deacon)
on Jul 22, 2013 at 01:44 UTC ( #1045559=note: print w/ replies, xml ) Need Help??


in reply to Trouble with Dates

Here is a solution also using Date::Calc.

#!/usr/bin/perl use strict; use warnings; use 5.014; use Date::Calc qw( Delta_Days Days_in_Month ); while (<DATA>) { my ($y1, $m1, $d1, $y2, $m2, $d2) = split /\D+/; $y2 ||= $y1; $m2 ||= $m1; $d2 ||= Days_in_Month($y2, $m2); # last day in current month say Delta_Days($y1, $m1, $d1, $y2, $m2, $d2); }


Comment on Re: Trouble with Dates
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (9)
As of 2014-08-01 22:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who would be the most fun to work for?















    Results (50 votes), past polls