Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: days between dates

by vagabonding electron (Hermit)
on Mar 16, 2013 at 15:35 UTC ( #1023829=note: print w/ replies, xml ) Need Help??


in reply to days between dates

Yet another option could be with Time::Piece (a core module now):

#!/usr/bin/perl use strict; use warnings; use Time::Piece; my $datf = Time::Piece->strptime("1/1/1904", "%d/%m/%Y"); my $datt = Time::Piece->strptime("5/3/2013", "%d/%m/%Y"); my $diff = $datt - $datf; my $result = $diff->days + 1462; print "$result days\n";
This prints "41338 days".


Comment on Re: days between dates
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2014-09-17 20:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (99 votes), past polls