Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: How do I Compare Dates

by davorg (Chancellor)
on Jun 27, 2000 at 15:17 UTC ( [id://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 having a coffee break in the Monastery: (4)
As of 2024-12-02 17:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found