Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: Compare two dates

by soonix (Canon)
on Jul 22, 2019 at 21:40 UTC ( [id://11103172]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    say DateTime->compare( $d1, $d2 ) 
        ? $d1->ymd .' is greater than ' . $d2->ymd 
        : $d2->ymd .' is greater or equal to ' . $d1->ymd;
    
  2. or download this
    say $d1->ymd . ' is ' . ('earlier than', 'equal to', 'later than')[Dat
    +eTime->compare( $d1, $d2 ) + 1] . ' ' . $d2->ymd;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-04-25 07:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found