Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
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 meditating upon the Monastery: (4)
As of 2020-10-31 08:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (287 votes). Check out past polls.

    Notices?