Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: How do I Compare Dates

by davorg (Chancellor)
on Jun 27, 2000 at 15:17 UTC ( #19980=note: print w/replies, xml ) Need Help??


in reply to How do I Compare Dates

Rather than getting the current date using `date`, why not use POSIX::strftime to get it in YYYY-MM-DD format. You can then use standard string comparison operators on the two dates.

use POSIX 'strftime'; my $now = strftime('%Y-%m-%d', localtime);

Date::Manip is probably overkill for this task (in fact it's probably overkill for most tasks.)

Originally posted as a Categorized Answer.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2023-12-05 15:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (27 votes). Check out past polls.

    Notices?