Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: How do I validate a date?

by plaid (Chaplain)
on May 25, 2000 at 03:06 UTC ( [id://14688]=note: print w/replies, xml ) Need Help??


in reply to How do I validate a date?

There are a couple ways to do this. The best that comes to mind is to grab a module for it (I prefer Date::Calc personally). You could then do something like
unless(check_date(param('year'), param('month'), param('day')) { # do something }
A non-modular way to accomplish this would be to create an array of month lengths, i.e.
my @month_lengths = (31, 28, 31, 30, ......);
which would require one additional check for leap-year.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-04-26 04:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found