Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: How do I find the difference in days between two dates, in a cool perl way?

by talexb (Chancellor)
on Apr 21, 2016 at 14:07 UTC ( [id://1161090]=note: print w/replies, xml ) Need Help??


in reply to How do I find the difference in days between two dates, in a cool perl way?

Use the utc_rd_values method in DateTime to get the day number of the date you're looking at:
my @start = $dt1->utc_rd_values; my @finish = $dt2->utc_rd_values; my $delta = $finish[0] - $start[0];
Now $delta contains the number of days between the two dates.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2024-04-20 08:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found