Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Another date related one.....

by blakem (Monsignor)
on Oct 11, 2002 at 21:58 UTC ( #204684=note: print w/replies, xml ) Need Help??


in reply to Another date related one.....

I prefer Time::Piece.
#!/usr/bin/perl -wT use strict; use Time::Piece; my $date1 = "01/01/2004"; my $date2 = "01/12/2003"; my $format = "%d/%m/%Y"; my $diff = Time::Piece->strptime($date1, $format) - Time::Piece->strptime($date2, $format); print $diff->days . " Days\n"; __END__ 31 Days

-Blake

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2019-08-25 20:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?