Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
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 drinking their drinks and smoking their pipes about the Monastery: (13)
As of 2015-07-01 15:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (8 votes), past polls