Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Compare two dates

by ablanke (Monsignor)
on Jul 22, 2019 at 19:39 UTC ( [id://11103162]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    if ($d2 >= $1) {
    
  2. or download this
    print "\n $d2 is greater or equal to  $d1\n";
    
  3. or download this
    DateTime->compare( $dt1, $dt2 )
    
  4. or download this
    use strict;
    use warnings;
    ...
        day       => 8,
        time_zone => 'America/Chicago',
    );
    
  5. or download this
    say DateTime->compare( $d1, $d2 ) > 0
        ? $d1->ymd .' is greater than ' . $d2->ymd 
        : $d2->ymd .' is greater or equal to ' . $d1->ymd;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (8)
As of 2024-04-16 09:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found