Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Another date related one.....

by blakem (Monsignor)
on Oct 11, 2002 at 21:58 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://204684]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (6)
As of 2024-04-16 17:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found