Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: days between dates

by vagabonding electron (Friar)
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 romping around the Monastery: (9)
As of 2014-04-16 10:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (424 votes), past polls