While using a module or a database's built in time/date functions
would be best you can do it as a straight numeric comparison.
But you must be very careful as to how you order those numbers or you'll get
Improper results.
# mmdd
$foo = 20030101;
$bar = 20021231;
# can even add hours minutes
Mark G'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Cc: "perl" <[EMAIL PROTECTED]>
Sent: Tuesday, May 27, 2003 5:10 PM
Subject: RE: Comparing Dates Conditional statements
>
> That won't work if the dates are more than a year apart(i.e. 100302 will
ginal Message-
From: Mark G [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 27, 2003 2:04 PM
To: [EMAIL PROTECTED]
Cc: perl
Subject: Re: Comparing Dates Conditional statements
> How can I have condition as such
>
> $date = 'XX/XX/XX'; <-insert any date
> If $date is
g;
if( $foo > $bar ){
print "\$foo is greater then \$bar \n";
}
elsif( $foo == $bar){
print "\$foo is equal to \$bar \n";
}
else {
print "\$bar is greater then \$foo \n";
}
<~~paste
- Original Message -
From: "Paul Kraus" <
How can I have condition as such
$date = 'XX/XX/XX'; <-insert any date
If $date is greater then 01/01/02 then do .
Else
Paul
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]