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

Re: How do I validate a date?

by frankus (Priest)
on Nov 05, 2001 at 19:29 UTC ( [id://123333]=note: print w/replies, xml ) Need Help??


in reply to How do I validate a date?

I wrote this today for a problem I've got, I'm sure the cook book says something similar..HTH :)
sub valid_date($$$){ my ($day,$month,$year)=@_; $month--; my $epoch=timelocal(0,0,0,$day,$month,$year); my $vdate=localtime($epoch); my @compdate=($vdate->mday,$vdate->mon+1,$vdate->year+1900); for (0..2){print ; if($compdate[$_]!=$_[$_]){ return 0}} 1; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2024-04-26 00:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found